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

Discussion in 'C++' started by AnonMail2005@gmail.com, May 6, 2010.

  1. Guest

    On May 6, 9:45 am, "Peter Olcott" <> 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
     
    , May 6, 2010
    #1
    1. Advertising

  2. Guest

    On May 6, 10:23 am, "Peter Olcott" <> wrote:
    > "" <> wrote in
    > messagenews:..com...
    > On May 6, 9:45 am, "Peter Olcott" <>
    > 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
     
    , May 6, 2010
    #2
    1. Advertising

  3. DaveB Guest

    Peter Olcott wrote:
    > "" <> wrote in
    > message
    > news:...
    > On May 6, 9:45 am, "Peter Olcott" <>
    > 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.

    ;)
     
    DaveB, May 14, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ravikanth[MVP]
    Replies:
    6
    Views:
    3,927
    Aemca
    Jul 18, 2003
  2. Thomas Scheiderich

    Best way to handle documents in ASP.NET

    Thomas Scheiderich, May 20, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    2,500
    Jim Corey
    May 20, 2004
  3. Victor Bazarov

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

    Victor Bazarov, May 6, 2010, in forum: C++
    Replies:
    84
    Views:
    2,541
    Joshua Maurice
    May 18, 2010
  4. Juha Nieminen

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

    Juha Nieminen, May 6, 2010, in forum: C++
    Replies:
    4
    Views:
    528
    DaveB
    May 14, 2010
  5. Yohan N. Leder

    Best way to output literal strings as UTF-8 ?

    Yohan N. Leder, Jun 1, 2006, in forum: Perl Misc
    Replies:
    4
    Views:
    112
    Bart Van der Donck
    Jun 2, 2006
Loading...

Share This Page