Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
3067 leency 1
 
2
{
3
   while (BL=ESBYTE[ESI])
4
   {
5
        IF (BL>=192)
6
        {
7
             IF (BL>=240) ESBYTE[ESI] = BL - 16;
8
             ELSE ESBYTE[ESI] = BL - 64;
9
        }
10
        ELSE
11
        {
12
			IF (BL==178) ESBYTE[ESI] = 73;  //I
13
			IF (BL==179) ESBYTE[ESI] = 105; //i
14
			IF (BL==175) ESBYTE[ESI] = 244; //J
15
			IF (BL==191) ESBYTE[ESI] = 245; //j
16
			IF (BL==170) ESBYTE[ESI] = 242; //E
17
			IF (BL==186) ESBYTE[ESI] = 243; //e
18
			IF (BL==168) ESBYTE[ESI] = 240; //р
19
			IF (BL==184) ESBYTE[ESI] = 'e'; //e
20
			IF (BL==180) ESBYTE[ESI] = 254; //г
21
			IF ((BL==147) || (BL==148) || (BL==171) || (BL==187)) ESBYTE[ESI] = 34;
22
			IF ((BL==150) || (BL==151)) ESBYTE[ESI] = 45;
23
        }
24
        ESI++;
25
   }
26
}
27
28
 
29
 
30
inline fastcall void koitodos( EDI)
31
{
32
	WHILE (BL=ESBYTE[EDI])
33
	{
34
		IF (BL >= 0xC0)
35
		{
36
			BL -= 0xC0;
37
			ESBYTE[EDI] = mas[BL];
38
		}
39
		//IF (ESBYTE[EDI]=='\244') ESBYTE[EDI]='i';
40
		EDI++;
41
	}
42
}
43
44
 
45
//uncomplete
46
inline fastcall void utf8rutodos( ESI)
47
{
48
    EDI=ESI;
49
  while (BL=ESBYTE[ESI])
50
  {
51
    IF (BL == 0xD0) || (BL == 0xD1) EDI--;
52
        else IF (BL == 0x81) && (ESBYTE[ESI-1]==0xD0) ESBYTE[EDI] = 0xF0; //ш
53
        else IF (BL == 0x91) && (ESBYTE[ESI-1]==0xD1) ESBYTE[EDI] = 0xF1; //м
54
        //0xE2 0x80 - сгруппировать
55
        else IF (BL == 0xE2) && (ESBYTE[ESI+1]==0x80)
56
        SWITCH (ESBYTE[ESI+2])
57
        {
58
        case 0x93: //long defis
59
        CASE 0x94:
60
        {
61
          ESBYTE[EDI] = '-';
62
          ESI+=2;
63
            BREAK;
64
        }
65
        CASE 0xA2: //central point
66
        {
67
          ESBYTE[EDI] = '*';
68
          ESI+=2;
69
            BREAK;
70
        }
71
        CASE 0xA6: //многоточие
72
        {
73
          ESBYTE[EDI] = ESBYTE[EDI+1] = ESBYTE[EDI+2] = '.';
74
          EDI+=2;
75
          ESI+=2;
76
          break;
77
          }
78
        }
79
80
 
81
          SWITCH(ESBYTE[ESI+1]) {
82
            case 0xAB: //"
83
            CASE 0xBB: //"
84
              {
85
                ESBYTE[EDI] = '\"';
86
                ESI++;
87
                BREAK;
88
              }
89
            CASE 0xB7: // _
90
              {
91
                ESBYTE[EDI] = '_';
92
                ESI++;
93
                BREAK;
94
              }
95
            CASE 0xA0: // Alt+160 - неразбивающий пробел
96
              {
97
                ESBYTE[EDI] = ' ';
98
                ESI++;
99
                BREAK;
100
              }
101
            CASE 0xB0: // градус
102
              {
103
                ESBYTE[EDI] = '\29';
104
                ESI++;
105
                BREAK;
106
              }
107
			CASE 0xA9: // (c) --- вылет О_о
108
			{
109
			  ESBYTE[EDI] = 'c';
110
			  ESI++;
111
			  BREAK;
112
			}
113
			CASE 0xAE: // (r)
114
			{
115
			  ESBYTE[EDI] = 'r';
116
			  ESI++;
117
			  BREAK;
118
			}
119
     }
120
121
 
122
    {
123
      BL -= 0x10;
124
      ESBYTE[EDI] = BL;
125
    }
126
        ELSE IF (BL >= 0x80) && (BL <= 0x8F)
127
    {
128
      BL += 0x60;
129
      ESBYTE[EDI] = BL;
130
    }
131
      ELSE IF (BL >= 0xB0) && (BL <= 0xBF)
132
    {
133
     BL -= 0x10;
134
     ESBYTE[EDI] = BL;
135
    }
136
    ELSE ESBYTE[EDI] = BL;
137
    ESI++;
138
    EDI++;
139
  }
140
  WHILE (EDI
141
  {
142
    ESBYTE[EDI] = ' ';
143
    EDI++;
144
   }
145
}
146
147
 
148
149
 
3412 leency 150
{
3067 leency 151
  dword j=0, symbol=0;
152
  char ch=0x00;
153
  FOR (;j<2;j++)
154
  {
155
    ch=ESBYTE[htmlcolor+j];
156
    IF (ch==0x0d) || (ch=='\9') RETURN 0;
4166 leency 157
    IF ((ch>='0') && (ch<='9')) ch -= '0';
3067 leency 158
    IF ((ch>='A') && (ch<='F')) ch -= 'A'-10;
159
    IF ((ch>='a') && (ch<='f')) ch -= 'a'-10;
160
    symbol = symbol*0x10 + ch;
161
  }
162
  wintodos(#symbol);
163
  AL=symbol;
164
}
3412 leency 165
>
166
 
4166 leency 167