Home > Back-end > Linux under the setlocale (LC_ALL, "zh_CN. GBK") set up to fail
Linux under the setlocale (LC_ALL, "zh_CN. GBK") set up to fail
Time:01-03
Under Linux can only set utf-8, seems to be able to set GBK? Linux coding environment how to modify? The locale - is a list of all supported set?
CodePudding user response:
Is Cannot be changed to GBK Is
I all the answer above is a shot in the dark,
CodePudding user response:
You seem to be some misunderstanding, the function of the function that you want to set to set what you, In fact, is not the case, This function set is actually a programmer expectations of this program to run the environment of the local character set in the future, That is to say, if you expect after you compile the code to run on Windows 7 8 of 10, then you can't write, This, of course, need the support of the compiler and library systems, with a lot of cross compiler configuration, you can just compiled on Linux link. Exe,
So, if your code to run on your machine to carry out a compilation, you look at the environment variable LANG is what, you can set it to what, what better way is between two double quotes doesn't knock,
CodePudding user response:
BTW, to success in this setting is complete, then use w system library functions, they don't use printf puts these functions, because they will be mischievous,
CodePudding user response:
LANG=zh_CN. GB2312
CodePudding user response:
When think of tea, the operating system this stuff, only when it is the source code, the kernel programmers have qualified to lift it,
Once it's up and running, although now it is not intelligent, but it has its own rules, I write the application of apes can only work in its regulations under the framework of the occasional request it do me a favor, In its place an acre of three points, it is heaven,
Fortunately, we live outside the system, not great can give it power, formatting, reshipment,
CodePudding user response:
TO: forever74 upstairs and incisive, praise a, By the way, could you show me my Fedora 33: