1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2006 by Frank Dischner
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
21 const char jamo_table
[51][3] = {
75 /* takes three jamo chars and joins them into one hangul */
76 unsigned short hangul_join(unsigned short lead
, unsigned short vowel
,
79 unsigned short ch
= 0xfffd;
81 if (lead
< 0x3131 || lead
> 0x3163)
83 lead
= jamo_table
[lead
-0x3131][0];
85 if (vowel
< 0x3131 || vowel
> 0x3163)
87 vowel
= jamo_table
[vowel
-0x3131][1];
90 if (tail
< 0x3131 || tail
> 0x3163)
92 tail
= jamo_table
[tail
-0x3131][2];
98 ch
= tail
+ (vowel
- 1)*28 + (lead
- 1)*588 + 44032;