zhcon/zhcon-0.2.6-locale.patch
2008-07-15 04:31:25 +00:00

70 lines
2.4 KiB
Diff

--- ./src/zhcon.h.locale 2008-07-14 11:14:23.000000000 +1000
+++ ./src/zhcon.h 2008-07-14 11:08:09.000000000 +1000
@@ -27,6 +27,10 @@
#include <string>
#include "global.h"
#include "cmdline.h"
+#define LOCALE_STR_UTF8 "utf8"
+#define LOCALE_STR_GB2312 "gb2312"
+#define LOCALE_STR_GBK "gbk"
+#define LOCALE_STR_BIG5 "big5"
using namespace std;
--- ./src/zhcon.cpp.locale 2008-07-14 11:21:29.000000000 +1000
+++ ./src/zhcon.cpp 2008-07-14 11:37:28.000000000 +1000
@@ -485,13 +485,13 @@
f = new BaseFont(mGB2312Font, 16, 16);
h = new GBDecoder();
}
- locale = "zh_CN.GB2312";
+ locale = "zh_CN." LOCALE_STR_GB2312;
break;
case GBK:
assert(font == GBK);
f = new BaseFont(mGBKFont, 16, 16);
h = new GBKDecoder();
- locale = "zh_CN.GBK";
+ locale = "zh_CN." LOCALE_STR_GBK;
break;
case BIG5:
assert(font == GB2312 || font == BIG5);
@@ -502,7 +502,7 @@
f = new BaseFont(mBIG5Font, 16, 16);
h = new BIG5Decoder();
}
- locale = "zh_TW.Big5";
+ locale = "zh_TW." LOCALE_STR_BIG5;
break;
case JIS:
assert(font == e);
@@ -647,22 +647,22 @@
setenv("LC_ALL", "zh_CN.EUC", 1);
#else
if (mArgs.utf8_flag)
- setenv("LC_ALL", "zh_CN.UTF-8", 1);
+ setenv("LC_ALL", "zh_CN." LOCALE_STR_UTF8, 1);
else
- setenv("LC_ALL", "zh_CN.GB2312", 1);
+ setenv("LC_ALL", "zh_CN." LOCALE_STR_GB2312, 1);
#endif
mDefaultEncode = GB2312;
} else if (s == "gbk") {
if (mArgs.utf8_flag)
- setenv("LC_ALL", "zh_CN.UTF-8", 1);
+ setenv("LC_ALL", "zh_CN." LOCALE_STR_UTF8, 1);
else
- setenv("LC_ALL", "zh_CN.GBK", 1);
+ setenv("LC_ALL", "zh_CN." LOCALE_STR_GBK, 1);
mDefaultEncode = GBK;
} else if (s == "big5") {
if (mArgs.utf8_flag)
- setenv("LC_ALL", "zh_TW.UTF-8", 1);
+ setenv("LC_ALL", "zh_TW." LOCALE_STR_UTF8, 1);
else
- setenv("LC_ALL", "zh_TW.Big5", 1);
+ setenv("LC_ALL", "zh_TW." LOCALE_STR_BIG5, 1);
mDefaultEncode = BIG5;
} else if (s == "jis") {
//SetEncode(JIS,JIS);