2020-03-26 01:12:32 +01:00
|
|
|
|
char *unicode_symbols[]={
|
2020-03-29 12:57:14 +02:00
|
|
|
|
"quot","\"",
|
|
|
|
|
"amp", "&",
|
|
|
|
|
"lt", "<",
|
|
|
|
|
"gt", ">",
|
|
|
|
|
"#183","\31", "middot", "\31",
|
2020-03-26 01:12:32 +01:00
|
|
|
|
"#149","-",
|
|
|
|
|
"#151","-",
|
2020-12-31 03:03:58 +01:00
|
|
|
|
"#160"," ", "nbsp", "\t", "emsp", " ",
|
2020-03-26 01:12:32 +01:00
|
|
|
|
"#169","(c)", "copy", "(c)",
|
|
|
|
|
"#171","<<", "laquo","<<",
|
|
|
|
|
"#174","(r)", "reg", "(r)",
|
|
|
|
|
"#187",">>", "raquo",">>",
|
2021-07-26 09:21:58 +02:00
|
|
|
|
"hellip", "...",
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
|
|
|
|
"trade", "[TM]",
|
|
|
|
|
"bdquo", ",,",
|
|
|
|
|
|
|
|
|
|
"minus", "-",
|
|
|
|
|
"ndash", "-",
|
|
|
|
|
"mdash", "-", //--
|
|
|
|
|
|
2020-12-31 03:03:58 +01:00
|
|
|
|
"rsquo", "'", "apos", "'",
|
2020-03-30 23:29:52 +02:00
|
|
|
|
"sect", "#",
|
|
|
|
|
|
|
|
|
|
"ensp", " ",
|
|
|
|
|
"emsp13", " ",
|
|
|
|
|
"emsp14", " ",
|
|
|
|
|
"numsp", " ",
|
|
|
|
|
"puncsp", " ",
|
|
|
|
|
"thinsp", " ",
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2020-03-26 01:12:32 +01:00
|
|
|
|
"#1028", "\242",
|
|
|
|
|
"#1030", "I",
|
|
|
|
|
"#1031", "\244",
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2020-03-26 01:12:32 +01:00
|
|
|
|
"#8211", "-",
|
2020-12-09 00:32:54 +01:00
|
|
|
|
"#8212", "-",
|
2020-03-26 01:12:32 +01:00
|
|
|
|
"#8217", "'",
|
2020-03-29 12:57:14 +02:00
|
|
|
|
"#8220", "\"",
|
2020-03-26 01:12:32 +01:00
|
|
|
|
"#8222", "\"", "ldquo", "\"",
|
|
|
|
|
"#8221", "\"", "rdquo", "\"",
|
|
|
|
|
"#8470", "N",
|
|
|
|
|
"#8722", "-",
|
|
|
|
|
"#9642", "-", //square in the middle of the line
|
2020-03-30 23:29:52 +02:00
|
|
|
|
"#9658", ">",
|
|
|
|
|
"#9660", "v",
|
2020-12-18 00:01:09 +01:00
|
|
|
|
"#10094", "<",
|
|
|
|
|
"#10095", ">",
|
2020-03-29 12:57:14 +02:00
|
|
|
|
"#65122", "+",
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2020-12-11 14:33:32 +01:00
|
|
|
|
"#8594", "->",
|
|
|
|
|
|
2020-12-13 01:32:34 +01:00
|
|
|
|
"uarr", "^",
|
|
|
|
|
"darr", "v",
|
|
|
|
|
"rarr", "->",
|
|
|
|
|
"larr", "<-",
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2020-03-26 01:12:32 +01:00
|
|
|
|
"bull", "\31",
|
2013-12-27 00:36:17 +01:00
|
|
|
|
"percnt","%",
|
|
|
|
|
|
2020-03-26 01:12:32 +01:00
|
|
|
|
"#xfeff", "",
|
|
|
|
|
|
2020-03-30 23:29:52 +02:00
|
|
|
|
"times", "x",
|
|
|
|
|
"lowast","*",
|
|
|
|
|
|
2013-12-27 00:36:17 +01:00
|
|
|
|
0};
|
|
|
|
|
|
|
|
|
|
|
2020-03-25 01:18:19 +01:00
|
|
|
|
unsigned char unicode_chars[] = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>h<EFBFBD>\243i\105\244\0";
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2020-12-28 22:43:46 +01:00
|
|
|
|
bool GetUnicodeSymbol(dword _line, line_size, bufpos, buf_end)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2020-12-28 22:43:46 +01:00
|
|
|
|
int i;
|
2020-03-29 12:57:14 +02:00
|
|
|
|
int code;
|
2020-12-28 22:43:46 +01:00
|
|
|
|
char special_code[10];
|
|
|
|
|
bool white_end = false;
|
|
|
|
|
dword bufstart = bufpos;
|
|
|
|
|
|
|
|
|
|
for (i=0; i<9; i++, bufpos++)
|
|
|
|
|
{
|
|
|
|
|
if (__isWhite(ESBYTE[bufpos])) {bufpos--; break;}
|
|
|
|
|
if (ESBYTE[bufpos] == ';') || (bufpos >= buf_end) break;
|
2021-07-26 09:21:58 +02:00
|
|
|
|
if (!strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ESBYTE[bufpos])) {bufpos--; break;}
|
2020-12-28 22:43:46 +01:00
|
|
|
|
special_code[i] = ESBYTE[bufpos];
|
|
|
|
|
}
|
|
|
|
|
special_code[i] = '\0';
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2020-12-28 22:43:46 +01:00
|
|
|
|
for (i=0; unicode_symbols[i]!=0; i+=2;)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2020-12-28 22:43:46 +01:00
|
|
|
|
if (!strcmp(#special_code, unicode_symbols[i]))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2020-12-28 22:43:46 +01:00
|
|
|
|
strncat(_line, unicode_symbols[i+1], line_size);
|
|
|
|
|
return bufpos;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-03-23 16:53:56 +01:00
|
|
|
|
|
2020-12-28 22:43:46 +01:00
|
|
|
|
if (special_code[0]=='#')
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2020-12-28 22:43:46 +01:00
|
|
|
|
code = atoi(#special_code + 1);
|
2020-03-29 12:57:14 +02:00
|
|
|
|
if (code>=0) && (code<=255) {
|
2020-12-28 22:43:46 +01:00
|
|
|
|
chrncat(_line, code, line_size); //NOT ALL ASCII CODES IN KOLIBRI ARE COMPATABLE WITH STANDARDS
|
|
|
|
|
return bufpos;
|
2020-03-29 12:57:14 +02:00
|
|
|
|
}
|
|
|
|
|
if (code>=1040) && (code<=1040+72) {
|
2020-12-28 22:43:46 +01:00
|
|
|
|
chrncat(_line, unicode_chars[code-1040], line_size);
|
|
|
|
|
return bufpos;
|
2020-03-25 01:18:19 +01:00
|
|
|
|
}
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
2020-03-23 16:53:56 +01:00
|
|
|
|
|
2020-12-28 22:43:46 +01:00
|
|
|
|
chrncat(_line, '&', line_size);
|
|
|
|
|
return bufstart;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|