Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: Best way to handle UTF-8 in C++

Reply
Thread Tools

Re: Best way to handle UTF-8 in C++

 
 
AnonMail2005@gmail.com
Guest
Posts: n/a
 
      05-06-2010
On May 6, 9:45*am, "Peter Olcott" <(E-Mail Removed)> wrote:
> I am looking for a way to handle UTF-8 text in my C++
> application. The ideal case would be an STL class that
> handles UTF-8. What is the next best thing?


I've worked with the iconv library which converts to/from various
character encodings.

Depending on your app, you may want to have only certain aspects of it
deal with character encodings.

For instance, we had an app that handled input and output via xml.
The app used ascii but the xml library (libxml2) required UTF-8. But
we just made our xml part of the code deal with the ascii to UTF-8
conversions - the rest of the app was unchanged.

HTH
 
Reply With Quote
 
 
 
 
AnonMail2005@gmail.com
Guest
Posts: n/a
 
      05-06-2010
On May 6, 10:23*am, "Peter Olcott" <(E-Mail Removed)> wrote:
> "(E-Mail Removed)" <(E-Mail Removed)> wrote in
> messagenews:(E-Mail Removed)..com...
> On May 6, 9:45 am, "Peter Olcott" <(E-Mail Removed)>
> wrote:
>
> > I am looking for a way to handle UTF-8 text in my C++
> > application. The ideal case would be an STL class that
> > handles UTF-8. What is the next best thing?

>
> --I've worked with the iconv library which converts to/from
> various
> --character encodings.
> -
> --Depending on your app, you may want to have only certain
> aspects of it
> --deal with character encodings.
>
> --For instance, we had an app that handled input and output
> via xml.
> --The app used ascii but the xml library (libxml2) required
> UTF-8. *But
> --we just made our xml part of the code deal with the ascii
> to UTF-8
> --conversions - the rest of the app was unchanged.
>
> --HTH
>
> From what I understand there is no ASCII to UTF-8
> conversion, UTF-8 is defined such that its first bytes are
> ASCII.


If so, then our conversion was a no-op. The point was that the io
encoding can be anything but almost all of the code was agnostic to
this. Only the xml interface dealt with the encoding.

HTH
 
Reply With Quote
 
 
 
 
DaveB
Guest
Posts: n/a
 
      05-14-2010
Peter Olcott wrote:
> "(E-Mail Removed)" <(E-Mail Removed)> wrote in
> message
> news:(E-Mail Removed)...
> On May 6, 9:45 am, "Peter Olcott" <(E-Mail Removed)>
> wrote:
>> I am looking for a way to handle UTF-8 text in my C++
>> application. The ideal case would be an STL class that
>> handles UTF-8. What is the next best thing?

>
> --I've worked with the iconv library which converts to/from
> various
> --character encodings.
> -
> --Depending on your app, you may want to have only certain
> aspects of it
> --deal with character encodings.
>
> --For instance, we had an app that handled input and output
> via xml.
> --The app used ascii but the xml library (libxml2) required
> UTF-8. But
> --we just made our xml part of the code deal with the ascii
> to UTF-8
> --conversions - the rest of the app was unchanged.
>
> --HTH
>
> From what I understand there is no ASCII to UTF-8
> conversion, UTF-8 is defined such that its first bytes are
> ASCII.


IM my girlfriend, dude. She "chats" on this thing and shows me everything
"new and improved". OK, don't. I love her. I'll learn to use this thing.
The world will just have to wait.




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
best way to handle sql decimal fields Steve Richter ASP .Net 3 03-31-2005 02:55 PM
What's the best way to handle showing/editing this data? Alan Silver ASP .Net 4 02-16-2005 06:23 PM
Best way to handle documents in ASP.NET Thomas Scheiderich ASP .Net 11 05-20-2004 05:57 PM
Question: Best way to handle DBNULL in datareaders Ravikanth[MVP] ASP .Net 6 07-18-2003 10:51 AM
Re: Best way to handle a mutually exclusive situation gabriel XML 0 06-25-2003 08:08 AM



Advertisments