By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,041 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,041 IT Pros & Developers. It's quick & easy.

convert an encoded string

P: n/a
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
Apr 10 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mon, 10 Apr 2006 21:22:30 +0800, Deephay <tu*****@gmail.com> 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/~a...FAQ-acllc.html
Apr 10 '06 #2

P: n/a
Jack Klein 写道:
On Mon, 10 Apr 2006 21:22:30 +0800, Deephay <tu*****@gmail.com> 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!
Apr 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.