You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "Alexander Zynevich (JIRA)" <ji...@apache.org> on 2008/04/10 13:48:08 UTC

[jira] Created: (ABDERA-145) PrettyWriter uses default system charset when no specified, but should use UTF-8 or charset of doc.

PrettyWriter uses default system charset when no specified, but should use UTF-8 or charset of doc.
---------------------------------------------------------------------------------------------------

                 Key: ABDERA-145
                 URL: https://issues.apache.org/jira/browse/ABDERA-145
             Project: Abdera
          Issue Type: Bug
    Affects Versions: 0.3.0, 0.4.0
            Reporter: Alexander Zynevich
            Priority: Minor


I see that when using PrettyWriter my code does not renders multilingual content correctly, (even when I set charsets explicitly in document)
When there is no charset in document UTF-8 is assumed (and this default will suit any content Chinese, Russian, etc.),
I would expect 
that PrerryWriter should also assume UTF-8 when no one is set explicitly
-- OR -- 
that PrettyWriter will look into passed document and get charset from there...

but
  public void writeTo(
    Base base, 
    OutputStream out, 
    WriterOptions options) 
      throws IOException {
    out = getCompressedOutputStream(out, options);
    String charset = options.getCharset();
    if (charset != null) {
      writeTo(base,new OutputStreamWriter(out,charset),options);
    } else {
      writeTo(base,new OutputStreamWriter(out),options);
    }

new OutputStreamWriter(out) gets operational system default charset
at least it should be 
new OutputStreamWriter(out, "UTF-8") in this else-branch.
    finishCompressedOutputStream(out, options);
    if (options.getAutoClose()) out.close();
  }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ABDERA-145) PrettyWriter uses default system charset when no specified, but should use UTF-8 or charset of doc.

Posted by "David Calavera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ABDERA-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Calavera updated ABDERA-145:
----------------------------------

    Attachment: pretty_writer_default_charset.patch

> PrettyWriter uses default system charset when no specified, but should use UTF-8 or charset of doc.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-145
>                 URL: https://issues.apache.org/jira/browse/ABDERA-145
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.3.0, 0.4.0
>            Reporter: Alexander Zynevich
>            Priority: Minor
>         Attachments: pretty_writer_default_charset.patch
>
>
> I see that when using PrettyWriter my code does not renders multilingual content correctly, (even when I set charsets explicitly in document)
> When there is no charset in document UTF-8 is assumed (and this default will suit any content Chinese, Russian, etc.),
> I would expect 
> that PrerryWriter should also assume UTF-8 when no one is set explicitly
> -- OR -- 
> that PrettyWriter will look into passed document and get charset from there...
> but
>   public void writeTo(
>     Base base, 
>     OutputStream out, 
>     WriterOptions options) 
>       throws IOException {
>     out = getCompressedOutputStream(out, options);
>     String charset = options.getCharset();
>     if (charset != null) {
>       writeTo(base,new OutputStreamWriter(out,charset),options);
>     } else {
>       writeTo(base,new OutputStreamWriter(out),options);
>     }
> new OutputStreamWriter(out) gets operational system default charset
> at least it should be 
> new OutputStreamWriter(out, "UTF-8") in this else-branch.
>     finishCompressedOutputStream(out, options);
>     if (options.getAutoClose()) out.close();
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ABDERA-145) PrettyWriter uses default system charset when no specified, but should use UTF-8 or charset of doc.

Posted by "James M Snell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ABDERA-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James M Snell resolved ABDERA-145.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.5.0

Checked in

> PrettyWriter uses default system charset when no specified, but should use UTF-8 or charset of doc.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-145
>                 URL: https://issues.apache.org/jira/browse/ABDERA-145
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.3.0, 0.4.0
>            Reporter: Alexander Zynevich
>            Priority: Minor
>             Fix For: 0.5.0
>
>         Attachments: pretty_writer_default_charset.patch
>
>
> I see that when using PrettyWriter my code does not renders multilingual content correctly, (even when I set charsets explicitly in document)
> When there is no charset in document UTF-8 is assumed (and this default will suit any content Chinese, Russian, etc.),
> I would expect 
> that PrerryWriter should also assume UTF-8 when no one is set explicitly
> -- OR -- 
> that PrettyWriter will look into passed document and get charset from there...
> but
>   public void writeTo(
>     Base base, 
>     OutputStream out, 
>     WriterOptions options) 
>       throws IOException {
>     out = getCompressedOutputStream(out, options);
>     String charset = options.getCharset();
>     if (charset != null) {
>       writeTo(base,new OutputStreamWriter(out,charset),options);
>     } else {
>       writeTo(base,new OutputStreamWriter(out),options);
>     }
> new OutputStreamWriter(out) gets operational system default charset
> at least it should be 
> new OutputStreamWriter(out, "UTF-8") in this else-branch.
>     finishCompressedOutputStream(out, options);
>     if (options.getAutoClose()) out.close();
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.