convert an encoded string

Discussion in 'C Programming' started by Deephay, Apr 10, 2006.

  1. Deephay

    Deephay Guest

    Greetings all,

    I have a problem with encode converting:
    Say, I have a string here, if I print it to stdout, I will got an ascii
    encoded string (locale do not effect), but I know that this string is in
    actually in another charset and I tried to use the iconv() to convert
    the encoding, but it will always return me the same anwser (the ascii
    string). How do I do the converting? thx very much!

    ps: I also want to know that what is the scheme to identify the mutibyte
    string / char (not the C function calls, just the scheme)

    Deephay
    Deephay, Apr 10, 2006
    #1
    1. Advertising

  2. Deephay

    Jack Klein Guest

    On Mon, 10 Apr 2006 21:22:30 +0800, Deephay <> wrote
    in comp.lang.c:

    > Greetings all,
    >
    > I have a problem with encode converting:


    Convert what encoding to what?

    > Say, I have a string here, if I print it to stdout, I will got an ascii
    > encoded string (locale do not effect), but I know that this string is in
    > actually in another charset and I tried to use the iconv() to convert
    > the encoding, but it will always return me the same anwser (the ascii
    > string). How do I do the converting? thx very much!


    I have no idea what iconv() is, it is not a standard C function.

    > ps: I also want to know that what is the scheme to identify the mutibyte
    > string / char (not the C function calls, just the scheme)
    >
    > Deephay


    You appear to have a problem with glyphs, that is the visible
    representation of characters when they appear on some output device
    such as a video terminal or printer. These are not controlled by the
    C language, but rather by the operating system and display device.

    As for multibyte character encodings, C does not specify what they
    are. You might want to look for information on
    http://www.unicode.org.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://c-faq.com/
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Apr 10, 2006
    #2
    1. Advertising

  3. Deephay

    Deephay Guest

    Jack Klein 写é“:
    > On Mon, 10 Apr 2006 21:22:30 +0800, Deephay <> wrote
    > in comp.lang.c:
    >
    >> Greetings all,
    >>
    >> I have a problem with encode converting:

    >
    > Convert what encoding to what?
    >
    >> Say, I have a string here, if I print it to stdout, I will got an ascii
    >> encoded string (locale do not effect), but I know that this string is in
    >> actually in another charset and I tried to use the iconv() to convert
    >> the encoding, but it will always return me the same anwser (the ascii
    >> string). How do I do the converting? thx very much!

    >
    > I have no idea what iconv() is, it is not a standard C function.

    the iconv is a glibc function, a generic encode converting function

    >
    >> ps: I also want to know that what is the scheme to identify the mutibyte
    >> string / char (not the C function calls, just the scheme)
    >>
    >> Deephay

    >
    > You appear to have a problem with glyphs, that is the visible
    > representation of characters when they appear on some output device
    > such as a video terminal or printer. These are not controlled by the
    > C language, but rather by the operating system and display device.

    no, I do not have problem with either my fonts or my locales, the string
    is actully a two-bytes (or may be three-bytes) character string, but the
    C? (System?) recognize it as an ascii string.
    I have no idea how to deal with it...

    >
    > As for multibyte character encodings, C does not specify what they
    > are. You might want to look for information on
    > http://www.unicode.org.
    >

    thx!
    Deephay, Apr 11, 2006
    #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. hb
    Replies:
    6
    Views:
    9,110
  2. Fritz Bayer
    Replies:
    5
    Views:
    24,273
    Fritz Bayer
    Oct 25, 2004
  3. Replies:
    6
    Views:
    87,974
    Mark Space
    Sep 26, 2006
  4. Stanley Xu
    Replies:
    2
    Views:
    595
    Stanley Xu
    Mar 23, 2011
  5. leonardo
    Replies:
    0
    Views:
    154
    leonardo
    Nov 18, 2012
Loading...

Share This Page