Locale setting and chinese file processing problems

B

Blackguester

Locale setting and chinese file processing problems

Hi, everybody
I'm tackling with some linux locale setting and character encoding
problem. I need to process some chinese files which encoded using
GB2312 and GBK, and in the other hand my linux locale setting is
"en_US.utf8". It suppose to be ok where using std::fstream and
std::string to process these files, but it turns out not. Every
chinese character can't be rightly recognized, but if I switch the
locale setting to "zh_CN.GBK", everything is all right! What
happening here? Why the change of locale make even the file
processing abnormal? Maybe I can use some wide string tech, but in
this case it seems that I should determine the locale setting first,
Is it the right way?
And I also turn to the gnu gettext, but it 's a different aspect, This
time I just need a way the uniquely process one encoding file that
indepedent with the current locale setting. So someone have any
suggestion? Thank u for reading this.

Loiy Shaw

VRV Tech
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top