Where to place Latin1 to UTF8/UTF16 converters

44 views
Skip to first unread message

Chris Bentzel

unread,
Sep 7, 2011, 12:38:47 PM9/7/11
to chromium-dev
I have some net code which deals with strings that are
ISO-8859-1/Latin1 and would like to store them in UTF-8 [or possibly
UTF-16] for the rest of the system.

UTF-16 conversion is trivial - UTF-8 is a bit more involved.

Does anyone else have a need for these functions to be added to
base/utf_string_conversions, or should I isolate to the net code?

Paweł Hajdan, Jr.

unread,
Sep 7, 2011, 12:48:37 PM9/7/11
to cben...@chromium.org, chromium-dev
Just curious for the context: what those ISO-8859-1 strings are? I remember some character encoding fun with FTP directory listing parser, and I wonder if this may be similar.

I also think we may already have converters for those like CodepageToUTF16 in icu_string_conversions.h


--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
   http://groups.google.com/a/chromium.org/group/chromium-dev

Chris Bentzel

unread,
Sep 7, 2011, 12:55:16 PM9/7/11
to Paweł Hajdan, Jr., chromium-dev
It's for HTTP auth realms - I'm trying to clean up the character
encodings used now that some of this is exposed to extensions.

Arguably the realm could also be RFC 2047 encoded, and there's
http://greenbytes.de/tech/webdav/draft-reschke-basicauth-enc-02.html
which would allow the server to specify the encoding of the realm as
well.

That being said, HTTP auth and internationalization is a big-old-can-of-worms

Chris Bentzel

unread,
Sep 7, 2011, 12:57:15 PM9/7/11
to Paweł Hajdan, Jr., chromium-dev
And I didn't know about icu_string_conversions.h - thanks for the
pointer, and that may be sufficient.

Chris Bentzel

unread,
Sep 7, 2011, 1:06:36 PM9/7/11
to Paweł Hajdan, Jr., chromium-dev
On Wed, Sep 7, 2011 at 12:55 PM, Chris Bentzel <cben...@chromium.org> wrote:
> It's for HTTP auth realms - I'm trying to clean up the character
> encodings used now that some of this is exposed to extensions.
>
> Arguably the realm could also be RFC 2047 encoded, and there's
> http://greenbytes.de/tech/webdav/draft-reschke-basicauth-enc-02.html
> which would allow the server to specify the encoding of the realm as
> well.

Oops, that proposal is for encoding of username/password only, not realm.

Reply all
Reply to author
Forward
0 new messages