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)
diff --git a/src/hangulin.c b/src/hangulin.c
index 337ea84..17142da 100644
--- a/src/hangulin.c
+++ b/src/hangulin.c
@@ -20,9 +20,9 @@
#define AUTOMATA_ERROR 4
#define AUTOMATA_NULL 5
-#define F_F 0x1 /* Ãʼº (initial sound) */
-#define F_M 0x2 /* Áß¼º (medial vowel) */
-#define F_L 0x4 /* Á¾¼º (final consonant) */
+#define F_F 0x1 /* 초성 (initial sound) */
+#define F_M 0x2 /* 중성 (medial vowel) */
+#define F_L 0x4 /* 종성 (final consonant) */
#define F_A 0x8 /* ASCII */
#define F_NULL 1
#define M_NULL 2
@@ -46,10 +46,10 @@
/**********************************************************************/
-/****** 3 ¹ú½ÄÀÚÆÇÀ» À§ÇÑ ·çƾ (Routines for 3 bulsik keyboard) ******/
+/****** 3 벌식자판을 위한 루틴 (Routines for 3 bulsik keyboard) ******/
/**********************************************************************/
-/* 3 ¹ú½Ä¿¡¼ ÀÚÆÇ º¯È¯ (3 bulsik keyboard conversion) */
+/* 3 벌식에서 자판 변환 (3 bulsik keyboard conversion) */
static char_u value_table_for_3[] =
{
@@ -89,7 +89,7 @@
F_F, F_M, F_L, F_L, F_F, F_L, /* u v w x y z */
};
-/* 3 ¹ú½Ä¿¡¼ (ÇöÀçÃʼº, ÀԷ¿µ¹®) -> º¹ÇÕÃʼº ó¸®
+/* 3 벌식에서 (현재초성, 입력영문) -> 복합초성 처리
* 3 bulsik: (current initial sound, input english) -> compound initial sound.
*/
@@ -109,7 +109,7 @@
return 0;
}
-/* 3 ¹ú½Ä¿¡¼ (ÇöÀç¸ðÀ½, ÀÔ·Â ¿µ¹®) -> º¹ÇÕ ¸ðÀ½ ó¸®
+/* 3 벌식에서 (현재모음, 입력 영문) -> 복합 모음 처리
* 3 bulsik: (current vowel, input english) -> compound vowel.
*/
@@ -118,34 +118,34 @@
{
switch (v)
{
- case 13: /* ¤Ç */
+ case 13: /* ㅗ */
switch (c) {
- case 3: /* ¤Ç¤¿ */
+ case 3: /* ㅗㅏ */
return 14;
- case 4: /* ¤Ç¤À */
+ case 4: /* ㅗㅐ */
return 15;
- case 29: /* ¤Ç¤Ó */
+ case 29: /* ㅗㅣ */
return 18;
}
break;
- case 20: /* ¤Ì */
+ case 20: /* ㅜ */
switch (c) {
- case 7: /* ¤Ì¤Ã */
+ case 7: /* ㅜㅓ */
return 21;
- case 10: /* ¤Ì¤Ä */
+ case 10: /* ㅜㅔ */
return 22;
- case 29: /* ¤Ì¤Ó */
+ case 29: /* ㅜㅣ */
return 23;
}
break;
- /* 3 ¹ú½Ä ÀÚÆÇÀº ¤Ñ¤Ó °¡ ÀÖÀ¸¹Ç·Î ... */
+ /* 3 벌식 자판은 ㅡㅣ 가 있으므로 ... */
}
return 0;
}
-/* 3 ¹ú½Ä¿¡¼ (ÇöÀç ¹Þħ, ¿µ¹®ÀÚ ÀÔ·Â) -> ¹Þħ
+/* 3 벌식에서 (현재 받침, 영문자 입력) -> 받침
* 3 bulsik: (current prop(?), input english) -> prop(?).
* I want to say, the 'prop' is similar to 'final consonant', but not vowel.
* (I cannot find the real english from my dictionary. Sorry!)
@@ -157,46 +157,46 @@
{
switch (k)
{
- case 2: /* ¤¡ */
+ case 2: /* ㄱ */
switch (c) {
case 2:
- return 3; /* ¤¡¤¡ */
+ return 3; /* ㄱㄱ */
case 21:
- return 4; /* ¤¡¤µ */
+ return 4; /* ㄱㅅ */
}
break;
- case 5: /* ¤¤ */
+ case 5: /* ㄴ */
switch (c) {
- case 24: /* ¤¤¤¸ */
+ case 24: /* ㄴㅈ */
return 6;
case 29:
- return 7; /* ¤¤¤¾ */
+ return 7; /* ㄴㅎ */
}
break;
- case 9: /* ¤© */
+ case 9: /* ㄹ */
switch (c) {
- case 2: /* ¤©¤¡ */
+ case 2: /* ㄹㄱ */
return 10;
- case 17: /* ¤©¤± */
+ case 17: /* ㄹㅁ */
return 11;
- case 19: /* ¤©¤² */
+ case 19: /* ㄹㅂ */
return 12;
- case 21: /* ¤©¤µ */
+ case 21: /* ㄹㅅ */
return 13;
- case 27: /* ¤©¤¼ */
+ case 27: /* ㄹㅌ */
return 14;
- case 28: /* ¤©¤½ */
+ case 28: /* ㄹㅍ */
return 15;
- case 29: /* ¤©¤¾ */
+ case 29: /* ㄹㅎ */
return 16;
}
break;
case 19:
switch (c) {
- case 21: /* ¤²¤µ */
+ case 21: /* ㅂㅅ */
return 20;
}
break;
@@ -205,7 +205,7 @@
}
/**********************************************************************/
-/****** 2 ¹ú½ÄÀÚÆÇÀ» À§ÇÑ ·çƾ (Routines for 2 bulsik keyboard) ******/
+/****** 2 벌식자판을 위한 루틴 (Routines for 2 bulsik keyboard) ******/
/**********************************************************************/
static int
@@ -227,9 +227,9 @@
return table[c];
}
-/* 2 ¹ú½Ä¿¡¼ ¿µ¹®ÀÚ -> Á¶ÇÕÇü Ãʼº º¯È¯
+/* 2 벌식에서 영문자 -> 조합형 초성 변환
* (2 bulsik: conversion english char. to initial sound of compound type)
- * °á°ú: ÃʼºÀÌ ¾Æ´Ï¸é 0 (If it is not initial sound, return 0).
+ * 결과: 초성이 아니면 0 (If it is not initial sound, return 0).
*/
static int
fcon(int c)
@@ -251,9 +251,9 @@
return table[c - 'E'];
}
-/* 2 ¹ú½Ä¿¡¼ ¿µ¹®ÀÚ -> Áß¼º º¯È¯
+/* 2 벌식에서 영문자 -> 중성 변환
* (2 bulsik: conversion english char. to medial vowel)
- * °á°ú: Áß¼ºÀÌ ¾Æ´Ï¸é 0 (If it is not medial vowel, return 0).
+ * 결과: 중성이 아니면 0 (If it is not medial vowel, return 0).
*/
static int
vow(int c)
@@ -273,9 +273,9 @@
return table[c - 'O'];
}
-/* 2¹ú½Ä¿¡¼ ¿µ¹®ÀÚ -> ¹Þħ º¯È¯
+/* 2벌식에서 영문자 -> 받침 변환
* (2 bulsik: conversion english char. to prop)
- * °á°ú: ¹ÞħÀÌ ¾Æ´Ï¸é 0 (If not prop, return 0)
+ * 결과: 받침이 아니면 0 (If not prop, return 0)
*/
static int
lcon(int c)
@@ -295,7 +295,7 @@
return table[c - 'R'];
}
-/* 2 ¹ú½Ä¿¡¼ (ÇöÀç ¹Þħ, ¿µ¹®ÀÚ ÀÔ·Â) -> ¹Þħ º¯È¯
+/* 2 벌식에서 (현재 받침, 영문자 입력) -> 받침 변환
* (2 bulsik: conversion (curr. prop, input english) to prop)
*/
@@ -304,44 +304,44 @@
{
switch (k)
{
- case 2: /* ¤¡ */
+ case 2: /* ㄱ */
switch (c) {
case 't':
- return 4; /* ¤¡¤µ */
+ return 4; /* ㄱㅅ */
}
break;
- case 5: /* ¤¤ */
+ case 5: /* ㄴ */
switch (c) {
- case 'w': /* ¤¤¤¸ */
+ case 'w': /* ㄴㅈ */
return 6;
- case 'g': /* ¤¤¤¾ */
+ case 'g': /* ㄴㅎ */
return 7;
}
break;
- case 9: /* ¤© */
+ case 9: /* ㄹ */
switch (c) {
- case 'r': /* ¤©¤¡ */
+ case 'r': /* ㄹㄱ */
return 10;
- case 'a': /* ¤©¤± */
+ case 'a': /* ㄹㅁ */
return 11;
- case 'q': /* ¤©¤² */
+ case 'q': /* ㄹㅂ */
return 12;
- case 't': /* ¤©¤µ */
+ case 't': /* ㄹㅅ */
return 13;
- case 'x': /* ¤©¤¼ */
+ case 'x': /* ㄹㅌ */
return 14;
- case 'v': /* ¤©¤½ */
+ case 'v': /* ㄹㅍ */
return 15;
- case 'g': /* ¤©¤¾ */
+ case 'g': /* ㄹㅎ */
return 16;
}
break;
- case 19: /* ¤² */
+ case 19: /* ㅂ */
switch (c) {
- case 't': /* ¤²¤µ */
+ case 't': /* ㅂㅅ */
return 20;
}
break;
@@ -349,7 +349,7 @@
return 0;
}
-/* 2¹ú½Ä¿¡¼ (ÇöÀç Áß¼º, ¿µ¹® ÀÔ·Â) -> Áß¼º º¯È¯
+/* 2벌식에서 (현재 중성, 영문 입력) -> 중성 변환
* (2 bulsik: conversion (curr. medial vowel, input english) to medial
* vowel)
*/
@@ -359,31 +359,31 @@
{
switch (v)
{
- case 13: /* ¤Ç */
+ case 13: /* ㅗ */
switch (c) {
- case 'k': /* ¤Ç¤¿ */
+ case 'k': /* ㅗㅏ */
return 14;
- case 'o': /* ¤Ç¤À */
+ case 'o': /* ㅗㅐ */
return 15;
- case 'l': /* ¤Ç¤Ó */
+ case 'l': /* ㅗㅣ */
return 18;
}
break;
- case 20: /* ¤Ì */
+ case 20: /* ㅜ */
switch (c) {
- case 'j': /* ¤Ì¤Ã */
+ case 'j': /* ㅜㅓ */
return 21;
- case 'p': /* ¤Ì¤Ä */
+ case 'p': /* ㅜㅔ */
return 22;
- case 'l': /* ¤Ì¤Ó */
+ case 'l': /* ㅜㅣ */
return 23;
}
break;
- case 27: /* ¤Ñ */
+ case 27: /* ㅡ */
switch (c) {
- case 'l': /* ¤Ñ¤Ó */
+ case 'l': /* ㅡㅣ */
return 28;
}
break;
@@ -465,7 +465,7 @@
t = *c;
switch (kind_table_for_2(t))
{
- case 0: /* ÀÚÀ½ (consonant) */
+ case 0: /* 자음 (consonant) */
if (f == F_NULL)
{
if (m != M_NULL)
@@ -481,7 +481,7 @@
if (l == L_NULL)
{
t2 = lcon(t);
- if (!t2) /* ¹ÞħÀ¸·Î ÀûÇÕÇÏÁö¾Ê´Ù (cannot use it as a prop) */
+ if (!t2) /* 받침으로 적합하지않다 (cannot use it as a prop) */
{
hangul_input_clear();
last_ll = last_l = -1;
@@ -498,7 +498,7 @@
push(buf);
return AUTOMATA_CORRECT;
}
- else /* ¹ÞħÀ¸·Î ¾²·ÁÇÏ¿´À¸³ª code¿¡ ¾ø´Â ±ÛÀÚÀÌ´Ù */
+ else /* 받침으로 쓰려하였으나 code에 없는 글자이다 */
{ /* cannot find such a prop in the code table */
last_ll = last_l = -1;
hangul_input_clear();
@@ -508,7 +508,7 @@
return AUTOMATA_NEW;
}
}
- /* ÃÊ Áß Á¾¼ºÀÌ ¸ðµÎ °®Ãß¾îÁ® ÀÖ´Ù
+ /* 초 중 종성이 모두 갖추어져 있다
* I have all the 'initial sound' and 'medial vowel' and 'final
* consonant'.
*/
@@ -573,7 +573,7 @@
sp = 0;
if (last_l == -1)
{
- /* À½... ÀÌ°Ô ÇÊ¿äÇϳª?? (Hmm... Is it needed?) */
+ /* 음... 이게 필요하나?? (Hmm... Is it needed?) */
convert_ks_to_3(buf, &f, &m, &l);
}
else
@@ -607,10 +607,10 @@
t = value_table_for_3[*c];
switch (kind_table_for_3[*c])
{
- case F_F: /* Ãʼº¹®ÀÚ (char. of an initial sound) */
+ case F_F: /* 초성문자 (char. of an initial sound) */
if (m != M_NULL || sp == 0)
{
- /* ÃʼºÀÌ ºñ¾ú°Å³ª ´ÙÀ½ ±ÛÀÚ ¸ðÀ¸±â ½ÃÀÛ
+ /* 초성이 비었거나 다음 글자 모으기 시작
* Empty 'initial sound', so starting automata.
*/
hangul_input_clear();
@@ -619,7 +619,7 @@
push(buf);
return AUTOMATA_NEW;
}
- if ((t2 = comfcon3(f,t)) != 0) /* º¹ÀÚÀ½ (double? consonant) */
+ if ((t2 = comfcon3(f,t)) != 0) /* 복자음 (double? consonant) */
{
f=t2;
convert_3_to_code(f, M_NULL, L_NULL, buf);
@@ -628,7 +628,7 @@
}
return AUTOMATA_ERROR;
- case F_M: /* ¸ðÀ½ (vowel) */
+ case F_M: /* 모음 (vowel) */
if (m == M_NULL)
{
if (2 != convert_3_to_code(f, t, L_NULL,buf))
@@ -641,7 +641,7 @@
else
return AUTOMATA_CORRECT;
}
- if ((t2 = comvow3(m,t))) /* º¹¸ðÀ½ (a diphthong) */
+ if ((t2 = comvow3(m,t))) /* 복모음 (a diphthong) */
{
m = t2;
convert_3_to_code(f, m, L_NULL, buf);
@@ -650,9 +650,9 @@
}
return AUTOMATA_ERROR;
- case F_L: /* ¹Þħ (prop?) */
+ case F_L: /* 받침 (prop?) */
if (m == M_NULL)
- return AUTOMATA_ERROR; /* Áß¼º¾ø´Â Á¾¼º */
+ return AUTOMATA_ERROR; /* 중성없는 종성 */
if (l == L_NULL)
{
if (2 != convert_3_to_code(f, m, t, buf))
@@ -664,7 +664,7 @@
l = t;
return AUTOMATA_CORRECT;
}
- if ((t2 = comcon3(l,t)) != 0) /* º¹ ¹Þħ ?? (double prop?) */
+ if ((t2 = comcon3(l,t)) != 0) /* 복 받침 ?? (double prop?) */
{
if (2 != convert_3_to_code(f, m, t2, buf))
return AUTOMATA_ERROR;
@@ -675,7 +675,7 @@
}
return AUTOMATA_ERROR;
- case F_A: /* Ư¼ö¹®ÀÚ³ª ¼ýÀÚ (special char. or number) */
+ case F_A: /* 특수문자나 숫자 (special char. or number) */
hangul_input_clear();
*c = t;
return AUTOMATA_SPECIAL;
@@ -1437,48 +1437,48 @@
{0xa4bd, 19, 2, 1}, {0xa4be, 20, 2, 1},
};
-/* Á¶ÇÕÇü Ãʼº - ¿Ï¼ºÇü ³¹ÀÚ º¯È¯
+/* 조합형 초성 - 완성형 낱자 변환
* conversion: initial sound of compound type - ??? of completion type
*/
static const char_u johab_fcon_to_wan[] =
{
0,
- 0xd4, 0xa1, 0xa2, 0xa4, 0xa7, /* (ä¿ò),¤¡,¤¢,¤¤,¤§ */
- 0xa8, 0xa9, 0xb1, 0xb2, 0xb3, /* ¤¨,¤©,¤±,¤²,¤³ */
- 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* ¤µ,¤¶,¤·,¤¸,¤¹ */
- 0xba, 0xbb, 0xbc, 0xbd, 0xbe /* ¤º,¤»,¤¼,¤½,¤¾ */
+ 0xd4, 0xa1, 0xa2, 0xa4, 0xa7, /* (채움),ㄱ,ㄲ,ㄴ,ㄷ */
+ 0xa8, 0xa9, 0xb1, 0xb2, 0xb3, /* ㄸ,ㄹ,ㅁ,ㅂ,ㅃ */
+ 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* ㅅ,ㅆ,ㅇ,ㅈ,ㅉ */
+ 0xba, 0xbb, 0xbc, 0xbd, 0xbe /* ㅊ,ㅋ,ㅌ,ㅍ,ㅎ */
};
-/* Á¶ÇÕÇü Áß¼º -> ¿Ï¼ºÇü ³¹ÀÚ º¯È¯
+/* 조합형 중성 -> 완성형 낱자 변환
* conversion: medial vowel of compound type - ??? of completion type
*/
static const char_u johab_vow_to_wan[] =
{
0, 0,
- 0xd4, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, /* (ä¿ò),¤¿,¤À,¤Á,¤Â,¤Ã */
+ 0xd4, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, /* (채움),ㅏ,ㅐ,ㅑ,ㅒ,ㅓ */
0, 0,
- 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, /* ¤Ä,¤Å,¤Æ,¤Ç,¤Ç¤¿,¤Ç¤À */
+ 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, /* ㅔ,ㅕ,ㅖ,ㅗ,ㅗㅏ,ㅗㅐ */
0, 0,
- 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* ¤Ç¤Ó,¤Ë,¤Ì,¤Ì¤Ã,¤Ì¤Ä,¤Ì¤Ó */
+ 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* ㅗㅣ,ㅛ,ㅜ,ㅜㅓ,ㅜㅔ,ㅜㅣ */
0, 0,
- 0xd0, 0xd1, 0xd2, 0xd3 /* ¤Ð,¤Ñ,¤Ñ¤Ó,¤Ó */
+ 0xd0, 0xd1, 0xd2, 0xd3 /* ㅠ,ㅡ,ㅡㅣ,ㅣ */
};
-/* Á¶ÇÕÇü Á¾¼º -> ¿Ï¼ºÇü ³¹ÀÚ º¯È¯
+/* 조합형 종성 -> 완성형 낱자 변환
* conversion: final consonant of compound type - ??? of completion type
*/
static const char_u johab_lcon_to_wan[] =
{
0,
- 0xd4, 0xa1, 0xa2, 0xa3, 0xa4, /* (ä¿ò), ¤¡, ¤¢, ¤¡¤µ, ¤¤ */
- 0xa5, 0xa6, 0xa7, 0xa9, 0xaa, /* ¤¤¤¸, ¤¤¤¾, ¤§, ¤©, ¤©¤¡ */
- 0xab, 0xac, 0xad, 0xae, 0xaf, /* ¤©¤±, ¤©¤², ¤©¤µ, ¤©¤¼, ¤©¤½ */
- 0xb0, 0xb1, 0, 0xb2, 0xb4, /* ¤©¤¾, ¤±, 0, ¤², ¤²¤µ */
- 0xb5, 0xb6, 0xb7, 0xb8, 0xba, /* ¤µ, ¤¶, ¤·, ¤¸, ¤º */
- 0xbb, 0xbc, 0xbd, 0xbe /* ¤», ¤¼, ¤½, ¤¾ */
+ 0xd4, 0xa1, 0xa2, 0xa3, 0xa4, /* (채움), ㄱ, ㄲ, ㄱㅅ, ㄴ */
+ 0xa5, 0xa6, 0xa7, 0xa9, 0xaa, /* ㄴㅈ, ㄴㅎ, ㄷ, ㄹ, ㄹㄱ */
+ 0xab, 0xac, 0xad, 0xae, 0xaf, /* ㄹㅁ, ㄹㅂ, ㄹㅅ, ㄹㅌ, ㄹㅍ */
+ 0xb0, 0xb1, 0, 0xb2, 0xb4, /* ㄹㅎ, ㅁ, 0, ㅂ, ㅂㅅ */
+ 0xb5, 0xb6, 0xb7, 0xb8, 0xba, /* ㅅ, ㅆ, ㅇ, ㅈ, ㅊ */
+ 0xbb, 0xbc, 0xbd, 0xbe /* ㅋ, ㅌ, ㅍ, ㅎ */
};
static void
@@ -1511,7 +1511,7 @@
*lp = ks_table2[i][3];
return;
}
- *fp = 0xff; /* ±×·¡ÇÈ ÄÚµå (graphic code) */
+ *fp = 0xff; /* 그래픽 코드 (graphic code) */
*mp = h;
*lp = low;
}
@@ -1584,13 +1584,13 @@
return 2; /* found */
}
- /* ¿Ï¼ºÇü Ç¥¿¡ ¾ø´Ù. ``KS C 5601 - 1992 Á¤º¸ ±³È¯¿ë ºÎÈ£ ÇØ¼³''
- * 3.3 Àý¿¡ ¼³¸íµÈ ¹æ¹ýÀ¸·Î encoding ÇÑ´Ù.
+ /* 완성형 표에 없다. ``KS C 5601 - 1992 정보 교환용 부호 해설''
+ * 3.3 절에 설명된 방법으로 encoding 한다.
*/
- *des++ = 0xa4; /* ä¿ò */
+ *des++ = 0xa4; /* 채움 */
*des++ = 0xd4;
- *des++ = 0xa4; /* ³¹ÀÚ´Â ¸ðµÎ a4 Çà¿¡ ÀÖ´Ù. */
+ *des++ = 0xa4; /* 낱자는 모두 a4 행에 있다. */
*des++ = johab_fcon_to_wan[fv];
*des++ = 0xa4;
*des++ = johab_vow_to_wan[mv];