summaryrefslogtreecommitdiff
path: root/src/xutf8/utils/euc_tw.c
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2009-03-18 04:47:01 +0000
committerGreg Ercolano <erco@seriss.com>2009-03-18 04:47:01 +0000
commit6cbde8909b551f9561f0a06c210fb9fc059c4485 (patch)
tree3d24e8bf8197cd62ccc5662523d0e88428d2e3a5 /src/xutf8/utils/euc_tw.c
parent5d601837b99ceb6285718034959bf38ca4a749cb (diff)
xutf8 files code conformance:
o C files containing C++ "//" comments -> C style "/* */" comments o Converted unintended doxygen style comments to regular C comments o FLTK brace/indent coding standard conformance o Tested linux + sgi o Avoided mods to xutf8/lcUniConv [libiconv/FSF code] to avoid unwanted diffs with future updates of that lib as per Fabien's fltk.dev request 03/14/09. (Those files already compliant anyway) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6698 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/xutf8/utils/euc_tw.c')
-rw-r--r--src/xutf8/utils/euc_tw.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/src/xutf8/utils/euc_tw.c b/src/xutf8/utils/euc_tw.c
index 54da80b46..523266653 100644
--- a/src/xutf8/utils/euc_tw.c
+++ b/src/xutf8/utils/euc_tw.c
@@ -32,36 +32,34 @@
char uni[0x10000];
#include "../utf8Utils.c"
-int main(int argc, char **argv)
-{
+int main(int argc, char **argv) {
- iconv_t cd;
+ iconv_t cd;
- int i;
- cd = iconv_open("EUC-TW", "UTF16");
- for(i = 0; i < 0x10000; i++) uni[i] = 0;
- for(i = 0x00000000; i < 0xFFFFFFFF; i++) {
- char buf[4], ob[6];
- char *b = buf;
- int ucs = -1;
- int l1 = 4, l2 = 6;
- char *o = ob ;
- buf[0] = i & 0xff;
- buf[1] = (i >> 8) & 0xFF;
- buf[2] = (i >> 16) & 0xFF;
- buf[3] = (i >> 24) & 0xFF;
- iconv(cd, NULL, NULL, NULL, NULL);
- iconv(cd, &b, &l1, &o, &l2);
- if (l2 != 6) {
- ucs = (unsigned)ob[0];
- ucs += (unsigned) (ob[1] << 8);
- //XConvertUtf8ToUcs((unsigned char*)ob, 6 - l2, &ucs);
- printf ("%x --> %X\n", i, ucs & 0xFFFF);
- }
-
- }
- iconv_close(cd);
- return 0;
+ int i;
+ cd = iconv_open("EUC-TW", "UTF16");
+ for(i = 0; i < 0x10000; i++) uni[i] = 0;
+ for(i = 0x00000000; i < 0xFFFFFFFF; i++) {
+ char buf[4], ob[6];
+ char *b = buf;
+ int ucs = -1;
+ int l1 = 4, l2 = 6;
+ char *o = ob ;
+ buf[0] = i & 0xff;
+ buf[1] = (i >> 8) & 0xFF;
+ buf[2] = (i >> 16) & 0xFF;
+ buf[3] = (i >> 24) & 0xFF;
+ iconv(cd, NULL, NULL, NULL, NULL);
+ iconv(cd, &b, &l1, &o, &l2);
+ if (l2 != 6) {
+ ucs = (unsigned)ob[0];
+ ucs += (unsigned) (ob[1] << 8);
+ //XConvertUtf8ToUcs((unsigned char*)ob, 6 - l2, &ucs);
+ printf ("%x --> %X\n", i, ucs & 0xFFFF);
+ }
+ }
+ iconv_close(cd);
+ return 0;
}
/*