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
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