You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mark Hindess <ma...@googlemail.com> on 2010/09/23 09:38:58 UTC

[classlib] Charset.toString() compatibility to aid poor code?

I've just seen some poor code for a simple HTTP server doing:

  "Content-Type: text/html; charset=" + charset

which on the RI gives the expected:

  Content-Type: text/html; charset=ISO-8859-1

but on Harmony gives:

  Content-Type: text/html; charset=Charset[ISO-8859-1]

which is then incorrect/unhelpful at the HTTP client end.

Perhaps we should just make Charset.toString() return just
Charset.canonicalName without the prefix?

If there are no objections then I'll change this later.

Regards,
 Mark.

  



Re: [classlib] Charset.toString() compatibility to aid poor code?

Posted by Tim Ellison <t....@gmail.com>.
+1

On 23/Sep/2010 08:38, Mark Hindess wrote:
> I've just seen some poor code for a simple HTTP server doing:
> 
>   "Content-Type: text/html; charset=" + charset
> 
> which on the RI gives the expected:
> 
>   Content-Type: text/html; charset=ISO-8859-1
> 
> but on Harmony gives:
> 
>   Content-Type: text/html; charset=Charset[ISO-8859-1]
> 
> which is then incorrect/unhelpful at the HTTP client end.
> 
> Perhaps we should just make Charset.toString() return just
> Charset.canonicalName without the prefix?
> 
> If there are no objections then I'll change this later.
> 
> Regards,
>  Mark.
> 
>   
> 
> 
>