Rev 8439 | Rev 8499 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8439 | Rev 8491 | ||
---|---|---|---|
1 | char *unicode_symbols[]={ |
1 | char *unicode_symbols[]={ |
2 | "quot","\"", |
2 | "quot","\"", |
3 | "amp", "&", |
3 | "amp", "&", |
4 | "lt", "<", |
4 | "lt", "<", |
5 | "gt", ">", |
5 | "gt", ">", |
6 | "#183","\31", "middot", "\31", |
6 | "#183","\31", "middot", "\31", |
7 | "#149","-", |
7 | "#149","-", |
8 | "#151","-", |
8 | "#151","-", |
9 | "#160"," ", "nbsp", " ", "emsp", " ", |
9 | "#160"," ", "nbsp", " ", "emsp", " ", |
10 | "#169","(c)", "copy", "(c)", |
10 | "#169","(c)", "copy", "(c)", |
11 | "#171","<<", "laquo","<<", |
11 | "#171","<<", "laquo","<<", |
12 | "#174","(r)", "reg", "(r)", |
12 | "#174","(r)", "reg", "(r)", |
13 | "#187",">>", "raquo",">>", |
13 | "#187",">>", "raquo",">>", |
14 | 14 | ||
15 | "trade", "[TM]", |
15 | "trade", "[TM]", |
16 | "bdquo", ",,", |
16 | "bdquo", ",,", |
17 | 17 | ||
18 | "minus", "-", |
18 | "minus", "-", |
19 | "ndash", "-", |
19 | "ndash", "-", |
20 | "mdash", "-", //-- |
20 | "mdash", "-", //-- |
21 | 21 | ||
22 | "rsquo", "'", |
22 | "rsquo", "'", |
23 | "sect", "#", |
23 | "sect", "#", |
24 | 24 | ||
25 | "ensp", " ", |
25 | "ensp", " ", |
26 | "emsp13", " ", |
26 | "emsp13", " ", |
27 | "emsp14", " ", |
27 | "emsp14", " ", |
28 | "numsp", " ", |
28 | "numsp", " ", |
29 | "puncsp", " ", |
29 | "puncsp", " ", |
30 | "thinsp", " ", |
30 | "thinsp", " ", |
31 | 31 | ||
32 | "#1028", "\242", |
32 | "#1028", "\242", |
33 | "#1030", "I", |
33 | "#1030", "I", |
34 | "#1031", "\244", |
34 | "#1031", "\244", |
35 | 35 | ||
36 | "#8211", "-", |
36 | "#8211", "-", |
37 | "#8212", "-", |
37 | "#8212", "-", |
38 | "#8217", "'", |
38 | "#8217", "'", |
39 | "#8220", "\"", |
39 | "#8220", "\"", |
40 | "#8222", "\"", "ldquo", "\"", |
40 | "#8222", "\"", "ldquo", "\"", |
41 | "#8221", "\"", "rdquo", "\"", |
41 | "#8221", "\"", "rdquo", "\"", |
42 | "#8470", "N", |
42 | "#8470", "N", |
43 | "#8722", "-", |
43 | "#8722", "-", |
44 | "#9642", "-", //square in the middle of the line |
44 | "#9642", "-", //square in the middle of the line |
45 | "#9658", ">", |
45 | "#9658", ">", |
46 | "#9660", "v", |
46 | "#9660", "v", |
47 | "#10094", "<", |
47 | "#10094", "<", |
48 | "#10095", ">", |
48 | "#10095", ">", |
49 | "#65122", "+", |
49 | "#65122", "+", |
50 | 50 | ||
51 | "#8594", "->", |
51 | "#8594", "->", |
52 | 52 | ||
53 | "uarr", "^", |
53 | "uarr", "^", |
54 | "darr", "v", |
54 | "darr", "v", |
55 | "rarr", "->", |
55 | "rarr", "->", |
56 | "larr", "<-", |
56 | "larr", "<-", |
57 | 57 | ||
58 | "bull", "\31", |
58 | "bull", "\31", |
59 | "percnt","%", |
59 | "percnt","%", |
60 | 60 | ||
61 | "#xfeff", "", |
61 | "#xfeff", "", |
62 | 62 | ||
63 | "times", "x", |
63 | "times", "x", |
64 | "lowast","*", |
64 | "lowast","*", |
65 | 65 | ||
66 | 0}; |
66 | 0}; |
67 | 67 | ||
68 | 68 | ||
69 | unsigned char unicode_chars[] = " ¡¢£¤¥¦§¨©ª«¬®¯àáâãäåæçèéêëìíîïðñh£\243i\105\244\0"; |
69 | unsigned char unicode_chars[] = " ¡¢£¤¥¦§¨©ª«¬®¯àáâãäåæçèéêëìíîïðñh£\243i\105\244\0"; |
70 | 70 | ||
71 | bool GetUnicodeSymbol(dword _line, in_tag, size) |
71 | bool GetUnicodeSymbol(dword _line, line_size, bufpos, buf_end) |
72 | { |
72 | { |
73 | int j; |
73 | int i; |
- | 74 | int code; |
|
- | 75 | char special_code[10]; |
|
- | 76 | bool white_end = false; |
|
74 | int code; |
77 | dword bufstart = bufpos; |
75 | 78 | ||
- | 79 | for (i=0; i<9; i++, bufpos++) |
|
- | 80 | { |
|
- | 81 | if (__isWhite(ESBYTE[bufpos])) {bufpos--; break;} |
|
- | 82 | if (ESBYTE[bufpos] == ';') || (bufpos >= buf_end) break; |
|
- | 83 | special_code[i] = ESBYTE[bufpos]; |
|
- | 84 | } |
|
- | 85 | special_code[i] = '\0'; |
|
- | 86 | ||
76 | for (j=0; unicode_symbols[j]!=0; j+=2;) |
87 | for (i=0; unicode_symbols[i]!=0; i+=2;) |
77 | { |
88 | { |
78 | if (!strcmp(in_tag, unicode_symbols[j])) |
89 | if (!strcmp(#special_code, unicode_symbols[i])) |
79 | { |
90 | { |
80 | strncat(_line, unicode_symbols[j+1], size); |
91 | strncat(_line, unicode_symbols[i+1], line_size); |
81 | return true; |
92 | return bufpos; |
82 | } |
93 | } |
83 | } |
94 | } |
84 | 95 | ||
85 | if (ESBYTE[in_tag]=='#') |
96 | if (special_code[0]=='#') |
86 | { |
97 | { |
87 | code = atoi(in_tag + 1); |
98 | code = atoi(#special_code + 1); |
88 | if (code>=0) && (code<=255) { |
99 | if (code>=0) && (code<=255) { |
89 | chrncat(_line, code, size); //NOT ALL ASCII CODES IN KOLIBRI ARE COMPATABLE WITH STANDARDS |
100 | chrncat(_line, code, line_size); //NOT ALL ASCII CODES IN KOLIBRI ARE COMPATABLE WITH STANDARDS |
90 | return true; |
101 | return bufpos; |
91 | } |
102 | } |
92 | if (code>=1040) && (code<=1040+72) { |
103 | if (code>=1040) && (code<=1040+72) { |
93 | chrncat(_line, unicode_chars[code-1040], size); |
104 | chrncat(_line, unicode_chars[code-1040], line_size); |
94 | return true; |
105 | return bufpos; |
95 | } |
106 | } |
96 | } |
107 | } |
- | 108 | ||
97 | 109 | chrncat(_line, '&', line_size); |
|
98 | return false; |
110 | return bufstart; |
99 | }=1040+72)>=255)>-",>", |
111 | }=1040+72)>=255)>9;>-",>", |
100 | "#10095",>", |
112 | "#10095",>", |
101 | "#174","(r)",><", |
113 | "#174","(r)",><", |
102 | "#174","(r)",>",><",>", |
114 | "#174","(r)",>",><",>", |
103 | "gt",> |
115 | "gt",> |