Mercurial > vim
comparison src/hangulin.c @ 17853:c90ca5b9fc0d v8.1.1923
patch 8.1.1923: some source files are not in a normal encoding
Commit: https://github.com/vim/vim/commit/4119309d70c7fc32637e77f2e84c185ad1768892
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 24 21:53:31 2019 +0200
patch 8.1.1923: some source files are not in a normal encoding
Problem: Some source files are not in a normal encoding.
Solution: Convert hangulin.c from euc-kr to utf-8 and digraph.c from latin1
to utf-8. (Daniel Hahler, closes #4731)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 24 Aug 2019 22:00:04 +0200 |
parents | 49ef396af986 |
children | d1e77015f60b |
comparison
equal
deleted
inserted
replaced
17852:c2c1389a9d45 | 17853:c90ca5b9fc0d |
---|---|
18 #define AUTOMATA_SPECIAL 2 | 18 #define AUTOMATA_SPECIAL 2 |
19 #define AUTOMATA_CORRECT_NEW 3 | 19 #define AUTOMATA_CORRECT_NEW 3 |
20 #define AUTOMATA_ERROR 4 | 20 #define AUTOMATA_ERROR 4 |
21 #define AUTOMATA_NULL 5 | 21 #define AUTOMATA_NULL 5 |
22 | 22 |
23 #define F_F 0x1 /* 檬己 (initial sound) */ | 23 #define F_F 0x1 /* 齑堨劚 (initial sound) */ |
24 #define F_M 0x2 /* 吝己 (medial vowel) */ | 24 #define F_M 0x2 /* 欷戩劚 (medial vowel) */ |
25 #define F_L 0x4 /* 辆己 (final consonant) */ | 25 #define F_L 0x4 /* 膦呾劚 (final consonant) */ |
26 #define F_A 0x8 /* ASCII */ | 26 #define F_A 0x8 /* ASCII */ |
27 #define F_NULL 1 | 27 #define F_NULL 1 |
28 #define M_NULL 2 | 28 #define M_NULL 2 |
29 #define L_NULL 1 | 29 #define L_NULL 1 |
30 | 30 |
44 | 44 |
45 #define convert_3_to_code convert_3_to_ks | 45 #define convert_3_to_code convert_3_to_ks |
46 | 46 |
47 | 47 |
48 /**********************************************************************/ | 48 /**********************************************************************/ |
49 /****** 3 国侥磊魄阑 困茄 风凭 (Routines for 3 bulsik keyboard) ******/ | 49 /****** 3 氩岇嫕鞛愴寪鞚 鞙勴暅 耄嫶 (Routines for 3 bulsik keyboard) ******/ |
50 /**********************************************************************/ | 50 /**********************************************************************/ |
51 | 51 |
52 /* 3 国侥俊辑 磊魄 函券 (3 bulsik keyboard conversion) */ | 52 /* 3 氩岇嫕鞐愳劀 鞛愴寪 氤頇 (3 bulsik keyboard conversion) */ |
53 | 53 |
54 static char_u value_table_for_3[] = | 54 static char_u value_table_for_3[] = |
55 { | 55 { |
56 24 , '"' , '#' , '$' , '%' , '&' , /* ! " # $ % & */ | 56 24 , '"' , '#' , '$' , '%' , '&' , /* ! " # $ % & */ |
57 18 , '(' , ')' , '*' , '+' , ',' , /* ' ( ) * + , */ | 57 18 , '(' , ')' , '*' , '+' , ',' , /* ' ( ) * + , */ |
87 F_F, F_F, F_F, F_F, F_F, F_F, /* i j k l m n */ | 87 F_F, F_F, F_F, F_F, F_F, F_F, /* i j k l m n */ |
88 F_F, F_F, F_L, F_M, F_L, F_M, /* o p q r s t */ | 88 F_F, F_F, F_L, F_M, F_L, F_M, /* o p q r s t */ |
89 F_F, F_M, F_L, F_L, F_F, F_L, /* u v w x y z */ | 89 F_F, F_M, F_L, F_L, F_F, F_L, /* u v w x y z */ |
90 }; | 90 }; |
91 | 91 |
92 /* 3 国侥俊辑 (泅犁檬己, 涝仿康巩) -> 汗钦檬己 贸府 | 92 /* 3 氩岇嫕鞐愳劀 (順勳灛齑堨劚, 鞛呺牓鞓侂) -> 氤淀暕齑堨劚 觳橂Μ |
93 * 3 bulsik: (current initial sound, input english) -> compound initial sound. | 93 * 3 bulsik: (current initial sound, input english) -> compound initial sound. |
94 */ | 94 */ |
95 | 95 |
96 static int | 96 static int |
97 comfcon3(int v, int c) | 97 comfcon3(int v, int c) |
107 if (v == 14 && c == 14) | 107 if (v == 14 && c == 14) |
108 return 15; | 108 return 15; |
109 return 0; | 109 return 0; |
110 } | 110 } |
111 | 111 |
112 /* 3 国侥俊辑 (泅犁葛澜, 涝仿 康巩) -> 汗钦 葛澜 贸府 | 112 /* 3 氩岇嫕鞐愳劀 (順勳灛氇潓, 鞛呺牓 鞓侂) -> 氤淀暕 氇潓 觳橂Μ |
113 * 3 bulsik: (current vowel, input english) -> compound vowel. | 113 * 3 bulsik: (current vowel, input english) -> compound vowel. |
114 */ | 114 */ |
115 | 115 |
116 static int | 116 static int |
117 comvow3(int v, int c) | 117 comvow3(int v, int c) |
118 { | 118 { |
119 switch (v) | 119 switch (v) |
120 { | 120 { |
121 case 13: /* で */ | 121 case 13: /* 銋 */ |
122 switch (c) { | 122 switch (c) { |
123 case 3: /* でた */ | 123 case 3: /* 銋椼厪 */ |
124 return 14; | 124 return 14; |
125 case 4: /* でだ */ | 125 case 4: /* 銋椼厫 */ |
126 return 15; | 126 return 15; |
127 case 29: /* でび */ | 127 case 29: /* 銋椼叄 */ |
128 return 18; | 128 return 18; |
129 } | 129 } |
130 break; | 130 break; |
131 | 131 |
132 case 20: /* ぬ */ | 132 case 20: /* 銋 */ |
133 switch (c) { | 133 switch (c) { |
134 case 7: /* ぬっ */ | 134 case 7: /* 銋溿厯 */ |
135 return 21; | 135 return 21; |
136 case 10: /* ぬつ */ | 136 case 10: /* 銋溿厰 */ |
137 return 22; | 137 return 22; |
138 case 29: /* ぬび */ | 138 case 29: /* 銋溿叄 */ |
139 return 23; | 139 return 23; |
140 } | 140 } |
141 break; | 141 break; |
142 | 142 |
143 /* 3 国侥 磊魄篮 ぱび 啊 乐栏骨肺 ... */ | 143 /* 3 氩岇嫕 鞛愴寪鞚 銋°叄 臧 鞛堨溂氙搿 ... */ |
144 } | 144 } |
145 return 0; | 145 return 0; |
146 } | 146 } |
147 | 147 |
148 /* 3 国侥俊辑 (泅犁 罐魔, 康巩磊 涝仿) -> 罐魔 | 148 /* 3 氩岇嫕鞐愳劀 (順勳灛 氚涭龚, 鞓侂鞛 鞛呺牓) -> 氚涭龚 |
149 * 3 bulsik: (current prop(?), input english) -> prop(?). | 149 * 3 bulsik: (current prop(?), input english) -> prop(?). |
150 * I want to say, the 'prop' is similar to 'final consonant', but not vowel. | 150 * I want to say, the 'prop' is similar to 'final consonant', but not vowel. |
151 * (I cannot find the real english from my dictionary. Sorry!) | 151 * (I cannot find the real english from my dictionary. Sorry!) |
152 * VIM: V = initial sound, I = medial vowel, M = final consonant. | 152 * VIM: V = initial sound, I = medial vowel, M = final consonant. |
153 */ | 153 */ |
155 static int | 155 static int |
156 comcon3(int k, int c) | 156 comcon3(int k, int c) |
157 { | 157 { |
158 switch (k) | 158 switch (k) |
159 { | 159 { |
160 case 2: /* ぁ */ | 160 case 2: /* 銊 */ |
161 switch (c) { | 161 switch (c) { |
162 case 2: | 162 case 2: |
163 return 3; /* ぁぁ */ | 163 return 3; /* 銊便劚 */ |
164 case 21: | 164 case 21: |
165 return 4; /* ぁさ */ | 165 return 4; /* 銊便厖 */ |
166 } | 166 } |
167 break; | 167 break; |
168 | 168 |
169 case 5: /* い */ | 169 case 5: /* 銊 */ |
170 switch (c) { | 170 switch (c) { |
171 case 24: /* いじ */ | 171 case 24: /* 銊淬厛 */ |
172 return 6; | 172 return 6; |
173 case 29: | 173 case 29: |
174 return 7; /* いぞ */ | 174 return 7; /* 銊淬厧 */ |
175 } | 175 } |
176 break; | 176 break; |
177 | 177 |
178 case 9: /* ぉ */ | 178 case 9: /* 銊 */ |
179 switch (c) { | 179 switch (c) { |
180 case 2: /* ぉぁ */ | 180 case 2: /* 銊广劚 */ |
181 return 10; | 181 return 10; |
182 case 17: /* ぉけ */ | 182 case 17: /* 銊广厑 */ |
183 return 11; | 183 return 11; |
184 case 19: /* ぉげ */ | 184 case 19: /* 銊广厒 */ |
185 return 12; | 185 return 12; |
186 case 21: /* ぉさ */ | 186 case 21: /* 銊广厖 */ |
187 return 13; | 187 return 13; |
188 case 27: /* ぉぜ */ | 188 case 27: /* 銊广厡 */ |
189 return 14; | 189 return 14; |
190 case 28: /* ぉそ */ | 190 case 28: /* 銊广厤 */ |
191 return 15; | 191 return 15; |
192 case 29: /* ぉぞ */ | 192 case 29: /* 銊广厧 */ |
193 return 16; | 193 return 16; |
194 } | 194 } |
195 break; | 195 break; |
196 | 196 |
197 case 19: | 197 case 19: |
198 switch (c) { | 198 switch (c) { |
199 case 21: /* げさ */ | 199 case 21: /* 銋傘厖 */ |
200 return 20; | 200 return 20; |
201 } | 201 } |
202 break; | 202 break; |
203 } | 203 } |
204 return 0; | 204 return 0; |
205 } | 205 } |
206 | 206 |
207 /**********************************************************************/ | 207 /**********************************************************************/ |
208 /****** 2 国侥磊魄阑 困茄 风凭 (Routines for 2 bulsik keyboard) ******/ | 208 /****** 2 氩岇嫕鞛愴寪鞚 鞙勴暅 耄嫶 (Routines for 2 bulsik keyboard) ******/ |
209 /**********************************************************************/ | 209 /**********************************************************************/ |
210 | 210 |
211 static int | 211 static int |
212 kind_table_for_2(int c) | 212 kind_table_for_2(int c) |
213 { | 213 { |
225 c -= 'a'; | 225 c -= 'a'; |
226 | 226 |
227 return table[c]; | 227 return table[c]; |
228 } | 228 } |
229 | 229 |
230 /* 2 国侥俊辑 康巩磊 -> 炼钦屈 檬己 函券 | 230 /* 2 氩岇嫕鞐愳劀 鞓侂鞛 -> 臁绊暕順 齑堨劚 氤頇 |
231 * (2 bulsik: conversion english char. to initial sound of compound type) | 231 * (2 bulsik: conversion english char. to initial sound of compound type) |
232 * 搬苞: 檬己捞 酒聪搁 0 (If it is not initial sound, return 0). | 232 * 瓴瓣臣: 齑堨劚鞚 鞎勲媹氅 0 (If it is not initial sound, return 0). |
233 */ | 233 */ |
234 static int | 234 static int |
235 fcon(int c) | 235 fcon(int c) |
236 { | 236 { |
237 static char_u table[] = | 237 static char_u table[] = |
249 if (c < 'E' || c > 'z') | 249 if (c < 'E' || c > 'z') |
250 return 0; | 250 return 0; |
251 return table[c - 'E']; | 251 return table[c - 'E']; |
252 } | 252 } |
253 | 253 |
254 /* 2 国侥俊辑 康巩磊 -> 吝己 函券 | 254 /* 2 氩岇嫕鞐愳劀 鞓侂鞛 -> 欷戩劚 氤頇 |
255 * (2 bulsik: conversion english char. to medial vowel) | 255 * (2 bulsik: conversion english char. to medial vowel) |
256 * 搬苞: 吝己捞 酒聪搁 0 (If it is not medial vowel, return 0). | 256 * 瓴瓣臣: 欷戩劚鞚 鞎勲媹氅 0 (If it is not medial vowel, return 0). |
257 */ | 257 */ |
258 static int | 258 static int |
259 vow(int c) | 259 vow(int c) |
260 { | 260 { |
261 static char_u table[] = | 261 static char_u table[] = |
271 if (c < 'O' || c > 'y') | 271 if (c < 'O' || c > 'y') |
272 return 0; | 272 return 0; |
273 return table[c - 'O']; | 273 return table[c - 'O']; |
274 } | 274 } |
275 | 275 |
276 /* 2国侥俊辑 康巩磊 -> 罐魔 函券 | 276 /* 2氩岇嫕鞐愳劀 鞓侂鞛 -> 氚涭龚 氤頇 |
277 * (2 bulsik: conversion english char. to prop) | 277 * (2 bulsik: conversion english char. to prop) |
278 * 搬苞: 罐魔捞 酒聪搁 0 (If not prop, return 0) | 278 * 瓴瓣臣: 氚涭龚鞚 鞎勲媹氅 0 (If not prop, return 0) |
279 */ | 279 */ |
280 static int | 280 static int |
281 lcon(int c) | 281 lcon(int c) |
282 { | 282 { |
283 static char_u table[] = | 283 static char_u table[] = |
293 if (c < 'R' || c > 'z') | 293 if (c < 'R' || c > 'z') |
294 return 0; | 294 return 0; |
295 return table[c - 'R']; | 295 return table[c - 'R']; |
296 } | 296 } |
297 | 297 |
298 /* 2 国侥俊辑 (泅犁 罐魔, 康巩磊 涝仿) -> 罐魔 函券 | 298 /* 2 氩岇嫕鞐愳劀 (順勳灛 氚涭龚, 鞓侂鞛 鞛呺牓) -> 氚涭龚 氤頇 |
299 * (2 bulsik: conversion (curr. prop, input english) to prop) | 299 * (2 bulsik: conversion (curr. prop, input english) to prop) |
300 */ | 300 */ |
301 | 301 |
302 static int | 302 static int |
303 comcon2(int k, int c) | 303 comcon2(int k, int c) |
304 { | 304 { |
305 switch (k) | 305 switch (k) |
306 { | 306 { |
307 case 2: /* ぁ */ | 307 case 2: /* 銊 */ |
308 switch (c) { | 308 switch (c) { |
309 case 't': | 309 case 't': |
310 return 4; /* ぁさ */ | 310 return 4; /* 銊便厖 */ |
311 } | 311 } |
312 break; | 312 break; |
313 | 313 |
314 case 5: /* い */ | 314 case 5: /* 銊 */ |
315 switch (c) { | 315 switch (c) { |
316 case 'w': /* いじ */ | 316 case 'w': /* 銊淬厛 */ |
317 return 6; | 317 return 6; |
318 case 'g': /* いぞ */ | 318 case 'g': /* 銊淬厧 */ |
319 return 7; | 319 return 7; |
320 } | 320 } |
321 break; | 321 break; |
322 | 322 |
323 case 9: /* ぉ */ | 323 case 9: /* 銊 */ |
324 switch (c) { | 324 switch (c) { |
325 case 'r': /* ぉぁ */ | 325 case 'r': /* 銊广劚 */ |
326 return 10; | 326 return 10; |
327 case 'a': /* ぉけ */ | 327 case 'a': /* 銊广厑 */ |
328 return 11; | 328 return 11; |
329 case 'q': /* ぉげ */ | 329 case 'q': /* 銊广厒 */ |
330 return 12; | 330 return 12; |
331 case 't': /* ぉさ */ | 331 case 't': /* 銊广厖 */ |
332 return 13; | 332 return 13; |
333 case 'x': /* ぉぜ */ | 333 case 'x': /* 銊广厡 */ |
334 return 14; | 334 return 14; |
335 case 'v': /* ぉそ */ | 335 case 'v': /* 銊广厤 */ |
336 return 15; | 336 return 15; |
337 case 'g': /* ぉぞ */ | 337 case 'g': /* 銊广厧 */ |
338 return 16; | 338 return 16; |
339 } | 339 } |
340 break; | 340 break; |
341 | 341 |
342 case 19: /* げ */ | 342 case 19: /* 銋 */ |
343 switch (c) { | 343 switch (c) { |
344 case 't': /* げさ */ | 344 case 't': /* 銋傘厖 */ |
345 return 20; | 345 return 20; |
346 } | 346 } |
347 break; | 347 break; |
348 } | 348 } |
349 return 0; | 349 return 0; |
350 } | 350 } |
351 | 351 |
352 /* 2国侥俊辑 (泅犁 吝己, 康巩 涝仿) -> 吝己 函券 | 352 /* 2氩岇嫕鞐愳劀 (順勳灛 欷戩劚, 鞓侂 鞛呺牓) -> 欷戩劚 氤頇 |
353 * (2 bulsik: conversion (curr. medial vowel, input english) to medial | 353 * (2 bulsik: conversion (curr. medial vowel, input english) to medial |
354 * vowel) | 354 * vowel) |
355 */ | 355 */ |
356 | 356 |
357 static int | 357 static int |
358 comvow2(int v, int c) | 358 comvow2(int v, int c) |
359 { | 359 { |
360 switch (v) | 360 switch (v) |
361 { | 361 { |
362 case 13: /* で */ | 362 case 13: /* 銋 */ |
363 switch (c) { | 363 switch (c) { |
364 case 'k': /* でた */ | 364 case 'k': /* 銋椼厪 */ |
365 return 14; | 365 return 14; |
366 case 'o': /* でだ */ | 366 case 'o': /* 銋椼厫 */ |
367 return 15; | 367 return 15; |
368 case 'l': /* でび */ | 368 case 'l': /* 銋椼叄 */ |
369 return 18; | 369 return 18; |
370 } | 370 } |
371 break; | 371 break; |
372 | 372 |
373 case 20: /* ぬ */ | 373 case 20: /* 銋 */ |
374 switch (c) { | 374 switch (c) { |
375 case 'j': /* ぬっ */ | 375 case 'j': /* 銋溿厯 */ |
376 return 21; | 376 return 21; |
377 case 'p': /* ぬつ */ | 377 case 'p': /* 銋溿厰 */ |
378 return 22; | 378 return 22; |
379 case 'l': /* ぬび */ | 379 case 'l': /* 銋溿叄 */ |
380 return 23; | 380 return 23; |
381 } | 381 } |
382 break; | 382 break; |
383 | 383 |
384 case 27: /* ぱ */ | 384 case 27: /* 銋 */ |
385 switch (c) { | 385 switch (c) { |
386 case 'l': /* ぱび */ | 386 case 'l': /* 銋°叄 */ |
387 return 28; | 387 return 28; |
388 } | 388 } |
389 break; | 389 break; |
390 } | 390 } |
391 return 0; | 391 return 0; |
463 return AUTOMATA_SPECIAL; | 463 return AUTOMATA_SPECIAL; |
464 } | 464 } |
465 t = *c; | 465 t = *c; |
466 switch (kind_table_for_2(t)) | 466 switch (kind_table_for_2(t)) |
467 { | 467 { |
468 case 0: /* 磊澜 (consonant) */ | 468 case 0: /* 鞛愳潓 (consonant) */ |
469 if (f == F_NULL) | 469 if (f == F_NULL) |
470 { | 470 { |
471 if (m != M_NULL) | 471 if (m != M_NULL) |
472 hangul_input_clear(); | 472 hangul_input_clear(); |
473 f = fcon(t); | 473 f = fcon(t); |
479 if (m == M_NULL) | 479 if (m == M_NULL) |
480 return AUTOMATA_ERROR; | 480 return AUTOMATA_ERROR; |
481 if (l == L_NULL) | 481 if (l == L_NULL) |
482 { | 482 { |
483 t2 = lcon(t); | 483 t2 = lcon(t); |
484 if (!t2) /* 罐魔栏肺 利钦窍瘤臼促 (cannot use it as a prop) */ | 484 if (!t2) /* 氚涭龚鞙茧 鞝來暕頃橃鞎婋嫟 (cannot use it as a prop) */ |
485 { | 485 { |
486 hangul_input_clear(); | 486 hangul_input_clear(); |
487 last_ll = last_l = -1; | 487 last_ll = last_l = -1; |
488 f = fcon(t); | 488 f = fcon(t); |
489 convert_3_to_code(f, m, l, buf); | 489 convert_3_to_code(f, m, l, buf); |
496 last_l = t; | 496 last_l = t; |
497 l = t2; | 497 l = t2; |
498 push(buf); | 498 push(buf); |
499 return AUTOMATA_CORRECT; | 499 return AUTOMATA_CORRECT; |
500 } | 500 } |
501 else /* 罐魔栏肺 静妨窍看栏唱 code俊 绝绰 臂磊捞促 */ | 501 else /* 氚涭龚鞙茧 鞊半牑頃橃榾鞙茧倶 code鞐 鞐嗠姅 旮鞛愳澊雼 */ |
502 { /* cannot find such a prop in the code table */ | 502 { /* cannot find such a prop in the code table */ |
503 last_ll = last_l = -1; | 503 last_ll = last_l = -1; |
504 hangul_input_clear(); | 504 hangul_input_clear(); |
505 f = fcon(t); | 505 f = fcon(t); |
506 convert_3_to_code(f, m, l, buf); | 506 convert_3_to_code(f, m, l, buf); |
507 push(buf); | 507 push(buf); |
508 return AUTOMATA_NEW; | 508 return AUTOMATA_NEW; |
509 } | 509 } |
510 } | 510 } |
511 /* 檬 吝 辆己捞 葛滴 爱眠绢廉 乐促 | 511 /* 齑 欷 膦呾劚鞚 氇憪 臧栰稊鞏挫牳 鞛堧嫟 |
512 * I have all the 'initial sound' and 'medial vowel' and 'final | 512 * I have all the 'initial sound' and 'medial vowel' and 'final |
513 * consonant'. | 513 * consonant'. |
514 */ | 514 */ |
515 t2 = comcon2(l, t); | 515 t2 = comcon2(l, t); |
516 if (t2) | 516 if (t2) |
571 pop(buf); | 571 pop(buf); |
572 pop(buf); | 572 pop(buf); |
573 sp = 0; | 573 sp = 0; |
574 if (last_l == -1) | 574 if (last_l == -1) |
575 { | 575 { |
576 /* 澜... 捞霸 鞘夸窍唱?? (Hmm... Is it needed?) */ | 576 /* 鞚... 鞚搓矊 頃勳殧頃橂倶?? (Hmm... Is it needed?) */ |
577 convert_ks_to_3(buf, &f, &m, &l); | 577 convert_ks_to_3(buf, &f, &m, &l); |
578 } | 578 } |
579 else | 579 else |
580 { | 580 { |
581 char_u tmp[3]; | 581 char_u tmp[3]; |
605 { | 605 { |
606 *c -= '!'; | 606 *c -= '!'; |
607 t = value_table_for_3[*c]; | 607 t = value_table_for_3[*c]; |
608 switch (kind_table_for_3[*c]) | 608 switch (kind_table_for_3[*c]) |
609 { | 609 { |
610 case F_F: /* 檬己巩磊 (char. of an initial sound) */ | 610 case F_F: /* 齑堨劚氍胳瀽 (char. of an initial sound) */ |
611 if (m != M_NULL || sp == 0) | 611 if (m != M_NULL || sp == 0) |
612 { | 612 { |
613 /* 檬己捞 厚菌芭唱 促澜 臂磊 葛栏扁 矫累 | 613 /* 齑堨劚鞚 牍勳棃瓯半倶 雼れ潓 旮鞛 氇溂旮 鞁滌瀾 |
614 * Empty 'initial sound', so starting automata. | 614 * Empty 'initial sound', so starting automata. |
615 */ | 615 */ |
616 hangul_input_clear(); | 616 hangul_input_clear(); |
617 f = t; | 617 f = t; |
618 convert_3_to_code(f, M_NULL, L_NULL, buf); | 618 convert_3_to_code(f, M_NULL, L_NULL, buf); |
619 push(buf); | 619 push(buf); |
620 return AUTOMATA_NEW; | 620 return AUTOMATA_NEW; |
621 } | 621 } |
622 if ((t2 = comfcon3(f,t)) != 0) /* 汗磊澜 (double? consonant) */ | 622 if ((t2 = comfcon3(f,t)) != 0) /* 氤奠瀽鞚 (double? consonant) */ |
623 { | 623 { |
624 f=t2; | 624 f=t2; |
625 convert_3_to_code(f, M_NULL, L_NULL, buf); | 625 convert_3_to_code(f, M_NULL, L_NULL, buf); |
626 push(buf); | 626 push(buf); |
627 return AUTOMATA_CORRECT; | 627 return AUTOMATA_CORRECT; |
628 } | 628 } |
629 return AUTOMATA_ERROR; | 629 return AUTOMATA_ERROR; |
630 | 630 |
631 case F_M: /* 葛澜 (vowel) */ | 631 case F_M: /* 氇潓 (vowel) */ |
632 if (m == M_NULL) | 632 if (m == M_NULL) |
633 { | 633 { |
634 if (2 != convert_3_to_code(f, t, L_NULL,buf)) | 634 if (2 != convert_3_to_code(f, t, L_NULL,buf)) |
635 return AUTOMATA_ERROR; | 635 return AUTOMATA_ERROR; |
636 | 636 |
639 if (f == F_NULL) | 639 if (f == F_NULL) |
640 return AUTOMATA_NEW; | 640 return AUTOMATA_NEW; |
641 else | 641 else |
642 return AUTOMATA_CORRECT; | 642 return AUTOMATA_CORRECT; |
643 } | 643 } |
644 if ((t2 = comvow3(m,t))) /* 汗葛澜 (a diphthong) */ | 644 if ((t2 = comvow3(m,t))) /* 氤惦鞚 (a diphthong) */ |
645 { | 645 { |
646 m = t2; | 646 m = t2; |
647 convert_3_to_code(f, m, L_NULL, buf); | 647 convert_3_to_code(f, m, L_NULL, buf); |
648 push(buf); | 648 push(buf); |
649 return AUTOMATA_CORRECT; | 649 return AUTOMATA_CORRECT; |
650 } | 650 } |
651 return AUTOMATA_ERROR; | 651 return AUTOMATA_ERROR; |
652 | 652 |
653 case F_L: /* 罐魔 (prop?) */ | 653 case F_L: /* 氚涭龚 (prop?) */ |
654 if (m == M_NULL) | 654 if (m == M_NULL) |
655 return AUTOMATA_ERROR; /* 吝己绝绰 辆己 */ | 655 return AUTOMATA_ERROR; /* 欷戩劚鞐嗠姅 膦呾劚 */ |
656 if (l == L_NULL) | 656 if (l == L_NULL) |
657 { | 657 { |
658 if (2 != convert_3_to_code(f, m, t, buf)) | 658 if (2 != convert_3_to_code(f, m, t, buf)) |
659 { | 659 { |
660 l = L_NULL; | 660 l = L_NULL; |
662 } | 662 } |
663 push(buf); | 663 push(buf); |
664 l = t; | 664 l = t; |
665 return AUTOMATA_CORRECT; | 665 return AUTOMATA_CORRECT; |
666 } | 666 } |
667 if ((t2 = comcon3(l,t)) != 0) /* 汗 罐魔 ?? (double prop?) */ | 667 if ((t2 = comcon3(l,t)) != 0) /* 氤 氚涭龚 ?? (double prop?) */ |
668 { | 668 { |
669 if (2 != convert_3_to_code(f, m, t2, buf)) | 669 if (2 != convert_3_to_code(f, m, t2, buf)) |
670 return AUTOMATA_ERROR; | 670 return AUTOMATA_ERROR; |
671 | 671 |
672 push(buf); | 672 push(buf); |
673 l = t2; | 673 l = t2; |
674 return AUTOMATA_CORRECT; | 674 return AUTOMATA_CORRECT; |
675 } | 675 } |
676 return AUTOMATA_ERROR; | 676 return AUTOMATA_ERROR; |
677 | 677 |
678 case F_A: /* 漂荐巩磊唱 箭磊 (special char. or number) */ | 678 case F_A: /* 韸轨垬氍胳瀽雮 靾瀽 (special char. or number) */ |
679 hangul_input_clear(); | 679 hangul_input_clear(); |
680 *c = t; | 680 *c = t; |
681 return AUTOMATA_SPECIAL; | 681 return AUTOMATA_SPECIAL; |
682 } | 682 } |
683 } | 683 } |
1435 {0xa4b9, 15, 2, 1}, {0xa4ba, 16, 2, 1}, | 1435 {0xa4b9, 15, 2, 1}, {0xa4ba, 16, 2, 1}, |
1436 {0xa4bb, 17, 2, 1}, {0xa4bc, 18, 2, 1}, | 1436 {0xa4bb, 17, 2, 1}, {0xa4bc, 18, 2, 1}, |
1437 {0xa4bd, 19, 2, 1}, {0xa4be, 20, 2, 1}, | 1437 {0xa4bd, 19, 2, 1}, {0xa4be, 20, 2, 1}, |
1438 }; | 1438 }; |
1439 | 1439 |
1440 /* 炼钦屈 檬己 - 肯己屈 彻磊 函券 | 1440 /* 臁绊暕順 齑堨劚 - 鞕勳劚順 雮膘瀽 氤頇 |
1441 * conversion: initial sound of compound type - ??? of completion type | 1441 * conversion: initial sound of compound type - ??? of completion type |
1442 */ | 1442 */ |
1443 | 1443 |
1444 static const char_u johab_fcon_to_wan[] = | 1444 static const char_u johab_fcon_to_wan[] = |
1445 { | 1445 { |
1446 0, | 1446 0, |
1447 0xd4, 0xa1, 0xa2, 0xa4, 0xa7, /* (盲框),ぁ,あ,い,ぇ */ | 1447 0xd4, 0xa1, 0xa2, 0xa4, 0xa7, /* (毂勳泙),銊,銊,銊,銊 */ |
1448 0xa8, 0xa9, 0xb1, 0xb2, 0xb3, /* え,ぉ,け,げ,こ */ | 1448 0xa8, 0xa9, 0xb1, 0xb2, 0xb3, /* 銊,銊,銋,銋,銋 */ |
1449 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* さ,ざ,し,じ,す */ | 1449 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* 銋,銋,銋,銋,銋 */ |
1450 0xba, 0xbb, 0xbc, 0xbd, 0xbe /* ず,せ,ぜ,そ,ぞ */ | 1450 0xba, 0xbb, 0xbc, 0xbd, 0xbe /* 銋,銋,銋,銋,銋 */ |
1451 }; | 1451 }; |
1452 | 1452 |
1453 /* 炼钦屈 吝己 -> 肯己屈 彻磊 函券 | 1453 /* 臁绊暕順 欷戩劚 -> 鞕勳劚順 雮膘瀽 氤頇 |
1454 * conversion: medial vowel of compound type - ??? of completion type | 1454 * conversion: medial vowel of compound type - ??? of completion type |
1455 */ | 1455 */ |
1456 | 1456 |
1457 static const char_u johab_vow_to_wan[] = | 1457 static const char_u johab_vow_to_wan[] = |
1458 { | 1458 { |
1459 0, 0, | 1459 0, 0, |
1460 0xd4, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, /* (盲框),た,だ,ち,ぢ,っ */ | 1460 0xd4, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, /* (毂勳泙),銋,銋,銋,銋,銋 */ |
1461 0, 0, | 1461 0, 0, |
1462 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, /* つ,づ,て,で,でた,でだ */ | 1462 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, /* 銋,銋,銋,銋,銋椼厪,銋椼厫 */ |
1463 0, 0, | 1463 0, 0, |
1464 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* でび,に,ぬ,ぬっ,ぬつ,ぬび */ | 1464 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 銋椼叄,銋,銋,銋溿厯,銋溿厰,銋溿叄 */ |
1465 0, 0, | 1465 0, 0, |
1466 0xd0, 0xd1, 0xd2, 0xd3 /* ば,ぱ,ぱび,び */ | 1466 0xd0, 0xd1, 0xd2, 0xd3 /* 銋,銋,銋°叄,銋 */ |
1467 }; | 1467 }; |
1468 | 1468 |
1469 /* 炼钦屈 辆己 -> 肯己屈 彻磊 函券 | 1469 /* 臁绊暕順 膦呾劚 -> 鞕勳劚順 雮膘瀽 氤頇 |
1470 * conversion: final consonant of compound type - ??? of completion type | 1470 * conversion: final consonant of compound type - ??? of completion type |
1471 */ | 1471 */ |
1472 | 1472 |
1473 static const char_u johab_lcon_to_wan[] = | 1473 static const char_u johab_lcon_to_wan[] = |
1474 { | 1474 { |
1475 0, | 1475 0, |
1476 0xd4, 0xa1, 0xa2, 0xa3, 0xa4, /* (盲框), ぁ, あ, ぁさ, い */ | 1476 0xd4, 0xa1, 0xa2, 0xa3, 0xa4, /* (毂勳泙), 銊, 銊, 銊便厖, 銊 */ |
1477 0xa5, 0xa6, 0xa7, 0xa9, 0xaa, /* いじ, いぞ, ぇ, ぉ, ぉぁ */ | 1477 0xa5, 0xa6, 0xa7, 0xa9, 0xaa, /* 銊淬厛, 銊淬厧, 銊, 銊, 銊广劚 */ |
1478 0xab, 0xac, 0xad, 0xae, 0xaf, /* ぉけ, ぉげ, ぉさ, ぉぜ, ぉそ */ | 1478 0xab, 0xac, 0xad, 0xae, 0xaf, /* 銊广厑, 銊广厒, 銊广厖, 銊广厡, 銊广厤 */ |
1479 0xb0, 0xb1, 0, 0xb2, 0xb4, /* ぉぞ, け, 0, げ, げさ */ | 1479 0xb0, 0xb1, 0, 0xb2, 0xb4, /* 銊广厧, 銋, 0, 銋, 銋傘厖 */ |
1480 0xb5, 0xb6, 0xb7, 0xb8, 0xba, /* さ, ざ, し, じ, ず */ | 1480 0xb5, 0xb6, 0xb7, 0xb8, 0xba, /* 銋, 銋, 銋, 銋, 銋 */ |
1481 0xbb, 0xbc, 0xbd, 0xbe /* せ, ぜ, そ, ぞ */ | 1481 0xbb, 0xbc, 0xbd, 0xbe /* 銋, 銋, 銋, 銋 */ |
1482 }; | 1482 }; |
1483 | 1483 |
1484 static void | 1484 static void |
1485 convert_ks_to_3( | 1485 convert_ks_to_3( |
1486 const char_u *src, | 1486 const char_u *src, |
1509 *fp = ks_table2[i][1]; | 1509 *fp = ks_table2[i][1]; |
1510 *mp = ks_table2[i][2]; | 1510 *mp = ks_table2[i][2]; |
1511 *lp = ks_table2[i][3]; | 1511 *lp = ks_table2[i][3]; |
1512 return; | 1512 return; |
1513 } | 1513 } |
1514 *fp = 0xff; /* 弊贰侨 内靛 (graphic code) */ | 1514 *fp = 0xff; /* 攴鸽灅頂 旖旊摐 (graphic code) */ |
1515 *mp = h; | 1515 *mp = h; |
1516 *lp = low; | 1516 *lp = low; |
1517 } | 1517 } |
1518 } | 1518 } |
1519 | 1519 |
1582 des[0] = mi / (0xff-0xa1) + 0xb0; | 1582 des[0] = mi / (0xff-0xa1) + 0xb0; |
1583 des[1] = mi % (0xff-0xa1) + 0xa1; | 1583 des[1] = mi % (0xff-0xa1) + 0xa1; |
1584 return 2; /* found */ | 1584 return 2; /* found */ |
1585 } | 1585 } |
1586 | 1586 |
1587 /* 肯己屈 钎俊 绝促. ``KS C 5601 - 1992 沥焊 背券侩 何龋 秦汲'' | 1587 /* 鞕勳劚順 響滌棎 鞐嗠嫟. ``KS C 5601 - 1992 鞝曤炒 甑愴櫂鞖 攵順 頃挫劋'' |
1588 * 3.3 例俊 汲疙等 规过栏肺 encoding 茄促. | 1588 * 3.3 鞝堨棎 靹る獏霅 氚╇矔鞙茧 encoding 頃滊嫟. |
1589 */ | 1589 */ |
1590 | 1590 |
1591 *des++ = 0xa4; /* 盲框 */ | 1591 *des++ = 0xa4; /* 毂勳泙 */ |
1592 *des++ = 0xd4; | 1592 *des++ = 0xd4; |
1593 *des++ = 0xa4; /* 彻磊绰 葛滴 a4 青俊 乐促. */ | 1593 *des++ = 0xa4; /* 雮膘瀽電 氇憪 a4 頄夓棎 鞛堧嫟. */ |
1594 *des++ = johab_fcon_to_wan[fv]; | 1594 *des++ = johab_fcon_to_wan[fv]; |
1595 *des++ = 0xa4; | 1595 *des++ = 0xa4; |
1596 *des++ = johab_vow_to_wan[mv]; | 1596 *des++ = johab_vow_to_wan[mv]; |
1597 *des++ = 0xa4; | 1597 *des++ = 0xa4; |
1598 *des++ = johab_lcon_to_wan[lv]; | 1598 *des++ = johab_lcon_to_wan[lv]; |