1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2006 by Frank Dischner
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
23 const char jamo_table
[51][3] = {
77 /* takes three jamo chars and joins them into one hangul */
78 unsigned short hangul_join(unsigned short lead
, unsigned short vowel
,
81 unsigned short ch
= 0xfffd;
83 if (lead
< 0x3131 || lead
> 0x3163)
85 lead
= jamo_table
[lead
-0x3131][0];
87 if (vowel
< 0x3131 || vowel
> 0x3163)
89 vowel
= jamo_table
[vowel
-0x3131][1];
92 if (tail
< 0x3131 || tail
> 0x3163)
94 tail
= jamo_table
[tail
-0x3131][2];
100 ch
= tail
+ (vowel
- 1)*28 + (lead
- 1)*588 + 44032;