summaryrefslogtreecommitdiffstats
path: root/src/hangulin.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-24 21:53:31 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-24 21:53:31 +0200
commit4119309d70c7fc32637e77f2e84c185ad1768892 (patch)
treefd529095f9005b572d6f7ca1c15b98620f443120 /src/hangulin.c
parent4f57eefe1e84b5a90e08474092ea6fc8825ad5c9 (diff)
patch 8.1.1923: some source files are not in a normal encodingv8.1.1923
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)
Diffstat (limited to 'src/hangulin.c')
-rw-r--r--src/hangulin.c204
1 files changed, 102 insertions, 102 deletions
diff --git a/src/hangulin.c b/src/hangulin.c
index 337ea84f4c..17142dadf6 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 @@ static int convert_3_to_ks(int fv, int mv, int lv, char_u *des);
/**********************************************************************/
-/****** 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 @@ static short_u kind_table_for_3[] =
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 @@ comfcon3(int v, int c)
return 0;
}
-/* 3 Ŀ (, Է ) -> ó
+/* 3 벌식에서 (현재모음, 입력 영문) -> 복합 모음 처리
* 3 bulsik: (current vowel, input english) -> compound vowel.
*/
@@ -118,34 +118,34 @@ comvow3(int v, int c)
{
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 @@ comcon3(int k, int c)
{
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 @@ comcon3(int k, int c)
}
/**********************************************************************/
-/****** 2 ƾ (Routines for 2 bulsik keyboard) ******/
+/****** 2 벌식자판을 위한 루틴 (Routines for 2 bulsik keyboard) ******/
/**********************************************************************/
static int
@@ -227,9 +227,9 @@ kind_table_for_2(int c)
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 @@ fcon(int c)
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 @@ vow(int c)
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 @@ lcon(int c)
return table[c - 'R'];
}
-/* 2 Ŀ ( ħ, Է) -> ħ ȯ
+/* 2 벌식에서 (현재 받침, 영문자 입력) -> 받침 변환
* (2 bulsik: conversion (curr. prop, input english) to prop)
*/
@@ -304,44 +304,44 @@ comcon2(int k, int c)
{
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 @@ comcon2(int k, int c)
return 0;
}
-/* 2Ŀ ( ߼, Է) -> ߼ ȯ
+/* 2벌식에서 (현재 중성, 영문 입력) -> 중성 변환
* (2 bulsik: conversion (curr. medial vowel, input english) to medial
* vowel)
*/
@@ -359,31 +359,31 @@ comvow2(int v, int c)
{
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 @@ hangul_automata2(char_u *buf, int_u *c)
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 @@ hangul_automata2(char_u *buf, int_u *c)
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 @@ hangul_automata2(char_u *buf, int_u *c)
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 @@ hangul_automata2(char_u *buf, int_u *c)
return AUTOMATA_NEW;
}
}
- /* ߾ ִ
+ /* 초 중 종성이 모두 갖추어져 있다
* I have all the 'initial sound' and 'medial vowel' and 'final
* consonant'.
*/
@@ -573,7 +573,7 @@ hangul_automata2(char_u *buf, int_u *c)
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 @@ hangul_automata3(char_u *buf, int_u *c)
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 @@ hangul_automata3(char_u *buf, int_u *c)
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 @@ hangul_automata3(char_u *buf, int_u *c)
}
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 @@ hangul_automata3(char_u *buf, int_u *c)
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 @@ hangul_automata3(char_u *buf, int_u *c)
}
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 @@ hangul_automata3(char_u *buf, int_u *c)
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 @@ hangul_automata3(char_u *buf, int_u *c)
}
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 @@ static const unsigned short ks_table2[][4] =
{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 @@ convert_ks_to_3(
*lp = ks_table2[i][3];
return;
}
- *fp = 0xff; /* ׷ ڵ (graphic code) */
+ *fp = 0xff; /* 그래픽 코드 (graphic code) */
*mp = h;
*lp = low;
}
@@ -1584,13 +1584,13 @@ convert_3_to_ks(
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];