Subversion Repositories Kolibri OS

Rev

Rev 7752 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7752 leency 1
char *unicode_symbols[]={
7757 leency 2
"quot","\"",
3
"amp", "&",
4
"lt",  "<",
5
"gt",  ">",
6
"#183","\31",   "middot", "\31",
7752 leency 7
"#149","-",
8
"#151","-",
9
"#160"," ",     "nbsp", " ",
10
"#169","(c)",   "copy", "(c)",
11
"#171","<<",    "laquo","<<",
12
"#174","(r)",   "reg",  "(r)",
13
"#187",">>",    "raquo",">>",
4411 leency 14
 
15
"trade", "[TM]",
16
"bdquo", ",,",
17
 
18
"minus", "-",
19
"ndash", "-",
20
"mdash", "-", //--
21
 
22
"rsquo", "'",
23
 
7752 leency 24
"#1028", "\242",
25
"#1030", "I",
26
"#1031", "\244",
4411 leency 27
 
7752 leency 28
"#8211", "-",
29
"#8217", "'",
7757 leency 30
"#8220", "\"",
7752 leency 31
"#8222", "\"", "ldquo", "\"",
32
"#8221", "\"", "rdquo", "\"",
33
"#8470", "N",
34
"#8722", "-",
35
"#9642", "-", //square in the middle of the line
7757 leency 36
"#65122", "+",
4411 leency 37
 
38
"uarr",  "\24",
39
"darr",  "\25",
40
"rarr",  "\26",
41
"larr",  "\27",
42
 
7752 leency 43
"bull",  "\31",
4411 leency 44
"percnt","%",
45
 
7752 leency 46
"#xfeff", "",
47
 
4411 leency 48
0};
49
 
50
 
7750 leency 51
unsigned char unicode_chars[] = "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏเแโใไๅๆ็่้๊๋์ํ๎๏๐๑hฃ\243i\105\244\0";
4411 leency 52
 
7757 leency 53
bool GetUnicodeSymbol(dword _line, in_tag, size)
4411 leency 54
{
7757 leency 55
	int j;
56
	int code;
4411 leency 57
 
7752 leency 58
	for (j=0; unicode_symbols[j]!=0; j+=2;)
4411 leency 59
	{
7752 leency 60
		if (!strcmp(in_tag, unicode_symbols[j]))
4411 leency 61
		{
7757 leency 62
			strncat(_line, unicode_symbols[j+1], size);
7749 leency 63
			return true;
4411 leency 64
		}
65
	}
7749 leency 66
 
7757 leency 67
	if (ESBYTE[in_tag]=='#')
4411 leency 68
	{
7757 leency 69
		code = atoi(in_tag + 1);
70
		if (code>=0) && (code<=255)	{
71
			chrncat(_line, code, size); //NOT ALL ASCII CODES IN KOLIBRI ARE COMPATABLE WITH STANDARDS
72
			return true;
7750 leency 73
		}
7757 leency 74
		if (code>=1040) && (code<=1040+72) {
75
			chrncat(_line, unicode_chars[code-1040], size);
76
			return true;
77
		}
4411 leency 78
	}
7749 leency 79
 
80
	return false;
4411 leency 81
}