Gen12 strings: span instead of runtime dictionary

More performant byte->str performance (no longer needing to hash byte and fetch bucket), unmeasured str->byte performance, but it is the same implementation as Gen3 which is not a bottleneck.
Reduces the dll size by 80KB, and RAM usage by an unmeasured (likely similar amount). Better startup speeds since multiple dictionaries do not need to be allocated and created.

Moves Gen1 trainer names (0x5D) to Transporter class, and remove Korean entry (not legally obtainable since there's only Gen2 Korean games and Gen2 Korean VC cannot trade with international).

Hard verify Gen1 trainer name for language, since 0x5D is the ROM transfer language. Nickname can still be from any of the connected games.

This refactor makes it easier to use a different charmap for byte<->str for Boxes (see #4027) and the language differences. We have a master table that "works" for all text name entry, but localizations differ for some glyphs accessible in the box naming UI.
This commit is contained in:
Kurt 2023-10-25 16:34:11 -07:00
parent 1816aefc25
commit 325f75e3d3
8 changed files with 396 additions and 1097 deletions

View file

@ -24,7 +24,6 @@ public sealed record EncounterTrade1 : IEncounterable, IEncounterMatch, IFixedTr
public bool IsFixedTrainer => true;
public bool IsFixedNickname => true;
private static IReadOnlyList<string> TrainerNames => StringConverter12.G1TradeOTName;
private string[] Nicknames { get; }
public ushort Species { get; }
public byte Form => 0;
@ -75,11 +74,9 @@ public sealed record EncounterTrade1 : IEncounterable, IEncounterMatch, IFixedTr
{
if (pk.Format <= 2)
return pk.OT_Trash is [StringConverter12.G1TradeOTCode, StringConverter12.G1TerminatorCode, ..];
return pk.Language switch
{
1 => GetIndex(pk.OT_Name, TrainerNames) == 1,
_ => GetIndex(pk.OT_Name, TrainerNames) >= 2,
};
var lang = pk.Language;
var expect = StringConverter12Transporter.GetTradeNameGen1(lang);
return pk.OT_Name == expect;
}
private int GetNicknameIndex(ReadOnlySpan<char> nickname) => GetIndex(nickname, Nicknames);

View file

@ -1,4 +1,4 @@
using static PKHeX.Core.LegalityCheckStrings;
using static PKHeX.Core.LegalityCheckStrings;
using static PKHeX.Core.CheckIdentifier;
namespace PKHeX.Core;
@ -20,7 +20,7 @@ public sealed class MarkingVerifier : Verifier
private void VerifyFavoriteMark(LegalityAnalysis data, PKM pk)
{
// Can only be toggled on in LGP/E, and is retained via transfer to HOME and into other games.
if (pk is IFavorite { IsFavorite: true } && !pk.GG)
if (pk is IFavorite { IsFavorite: true } && !data.Info.EvoChainsAllGens.HasVisitedLGPE)
data.AddLine(GetInvalid(LFavoriteMarkingUnavailable));
}

View file

@ -230,7 +230,7 @@ public sealed class PK1 : GBPKML, IPersonalType
private string GetTransferTrainerName(int lang)
{
if (OT_Trash[0] == StringConverter12.G1TradeOTCode) // In-game Trade
return StringConverter12.G1TradeOTName[lang];
return StringConverter12Transporter.GetTradeNameGen1(lang);
return StringConverter12Transporter.GetString(OT_Trash, Japanese);
}
}

View file

@ -208,7 +208,7 @@ public sealed class PK2 : GBPKML, ICaughtData2
private string GetTransferTrainerName(int lang)
{
if (OT_Trash[0] == StringConverter12.G1TradeOTCode) // In-game Trade
return StringConverter12.G1TradeOTName[lang];
return StringConverter12Transporter.GetTradeNameGen1(lang);
if (Korean)
return OT_Name;
return StringConverter12Transporter.GetString(OT_Trash, Japanese);

View file

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
namespace PKHeX.Core;
@ -8,28 +7,29 @@ namespace PKHeX.Core;
/// </summary>
public static class StringConverter12
{
public static bool GetIsG1Japanese(ReadOnlySpan<char> str) => AllCharsInDictionary(str, U2RBY_J);
public static bool GetIsG1English(ReadOnlySpan<char> str) => AllCharsInDictionary(str, U2RBY_U);
public static bool GetIsG1Japanese(ReadOnlySpan<byte> raw) => AllCharsInDictionary(raw, RBY2U_J);
public static bool GetIsG1English(ReadOnlySpan<byte> raw) => AllCharsInDictionary(raw, RBY2U_U);
public static bool GetIsG1Japanese(ReadOnlySpan<char> str) => AllJapanese(str);
private static bool AllCharsInDictionary(ReadOnlySpan<char> c, IReadOnlyDictionary<char, byte> d)
private static bool AllJapanese(ReadOnlySpan<char> str)
{
foreach (var x in c)
foreach (var x in str)
{
if (!d.ContainsKey(x))
if (!IsJapanese(x))
return false;
}
return true;
static bool IsJapanese(char c) => c is >= '\u3000' and <= '\u30FC'; // todo: bitmask check
}
private static bool AllCharsInDictionary(ReadOnlySpan<byte> data, IReadOnlyDictionary<byte, char> d)
public static bool GetIsG1English(ReadOnlySpan<char> str) => !GetIsG1Japanese(str);
public static bool GetIsG1Japanese(ReadOnlySpan<byte> raw) => AllCharsInTable(raw, TableJP);
public static bool GetIsG1English(ReadOnlySpan<byte> raw) => AllCharsInTable(raw, TableEN);
private static bool AllCharsInTable(ReadOnlySpan<byte> data, ReadOnlySpan<char> table)
{
foreach (var c in data)
{
if (c == 0)
break;
if (!d.ContainsKey(c))
var b = table[c];
if (b == G1Terminator && c is not (G1TerminatorCode or 0))
return false;
}
return true;
@ -41,19 +41,6 @@ public static class StringConverter12
public const char G1TradeOT = '*';
public const byte G1SpaceCode = 0x7F;
public static readonly IReadOnlyList<string> G1TradeOTName = new []
{
string.Empty,
"トレーナー",
"Trainer",
"Dresseur",
"Allenatore",
"Trainer",
string.Empty,
"Entrenador",
"트레이너",
};
/// <summary>
/// Checks if the input byte array is definitely of German origin (any ÄÖÜäöü)
/// </summary>
@ -71,6 +58,14 @@ public static class StringConverter12
private static bool IsGermanicGlyph(byte b) => b - 0xC0u <= 6;
private static bool IsGermanicGlyph(char c)
{
ulong i = c - (uint)'Ä';
ulong shift = 0x8000208080002080ul << (int)i;
ulong mask = i - 64;
return (long)(shift & mask) < 0;
}
/// <summary>
/// Checks if the input byte array is definitely of German origin (any ÄÖÜäöü)
/// </summary>
@ -78,13 +73,9 @@ public static class StringConverter12
/// <returns>Indication if the data is from a definitely-german string</returns>
public static bool IsG12German(ReadOnlySpan<char> value)
{
var table = U2RBY_U;
foreach (var c in value)
{
if (!table.TryGetValue(c, out var b))
continue;
if (IsGermanicGlyph(b))
if (IsGermanicGlyph(c))
return true;
}
return false;
@ -116,13 +107,12 @@ public static class StringConverter12
return 1;
}
var dict = jp ? RBY2U_J : RBY2U_U;
int i = 0;
var dict = jp ? TableJP : TableEN;
for (; i < data.Length; i++)
{
var value = data[i];
if (!dict.TryGetValue(value, out var c)) // Take valid values
break;
var c = dict[value];
if (c == G1Terminator) // Stop if Terminator
break;
result[i] = c;
@ -159,14 +149,15 @@ public static class StringConverter12
if (value.Length > maxLength)
value = value[..maxLength]; // Hard cap
var dict = jp ? U2RBY_J : U2RBY_U;
var dict = jp ? TableEN : TableJP;
int i = 0;
for (; i < value.Length; i++)
{
char c = value[i];
if (!dict.TryGetValue(c, out byte val))
var index = dict.IndexOf(c);
if (index is -1 or G1TerminatorCode)
break;
destBuffer[i] = val;
destBuffer[i] = (byte)index;
}
int count = i;
@ -176,614 +167,56 @@ public static class StringConverter12
return count + 1;
}
/// <summary>
/// Converts Generation 1 encoded character to string.
/// </summary>
/// <param name="key">Encoded character.</param>
/// <param name="jp">Data source is Japanese.</param>
/// <returns>Decoded string.</returns>
public static char GetG1Char(byte key, bool jp)
{
var dict = jp ? RBY2U_J : RBY2U_U;
if (dict.TryGetValue(key, out var value))
return value;
return G1Terminator;
}
#region Gen 1/2 Character Tables
internal static readonly Dictionary<byte, char> RBY2U_U = new(120)
private const char NUL = G1Terminator;
private const char TOT = G1TradeOT;
private const char LPK = '{'; // Pk
private const char LMN = '}'; // Mn
private const char MNY = '¥'; // Yen
private const char LPO = '@'; // Po
private const char LKE = '#'; // Ke
private const char LEA = '%'; // é for Box
private const char DOT = ''; // Not .
public static ReadOnlySpan<char> TableEN => new[]
{
{0x50, G1Terminator},
{0x5D, G1TradeOT},
{0x7F, ' '},
{0x80, 'A'},
{0x81, 'B'},
{0x82, 'C'},
{0x83, 'D'},
{0x84, 'E'},
{0x85, 'F'},
{0x86, 'G'},
{0x87, 'H'},
{0x88, 'I'},
{0x89, 'J'},
{0x8A, 'K'},
{0x8B, 'L'},
{0x8C, 'M'},
{0x8D, 'N'},
{0x8E, 'O'},
{0x8F, 'P'},
{0x90, 'Q'},
{0x91, 'R'},
{0x92, 'S'},
{0x93, 'T'},
{0x94, 'U'},
{0x95, 'V'},
{0x96, 'W'},
{0x97, 'X'},
{0x98, 'Y'},
{0x99, 'Z'},
{0x9A, '('},
{0x9B, ')'},
{0x9C, ':'},
{0x9D, ';'},
{0x9E, '['},
{0x9F, ']'},
{0xA0, 'a'},
{0xA1, 'b'},
{0xA2, 'c'},
{0xA3, 'd'},
{0xA4, 'e'},
{0xA5, 'f'},
{0xA6, 'g'},
{0xA7, 'h'},
{0xA8, 'i'},
{0xA9, 'j'},
{0xAA, 'k'},
{0xAB, 'l'},
{0xAC, 'm'},
{0xAD, 'n'},
{0xAE, 'o'},
{0xAF, 'p'},
{0xB0, 'q'},
{0xB1, 'r'},
{0xB2, 's'},
{0xB3, 't'},
{0xB4, 'u'},
{0xB5, 'v'},
{0xB6, 'w'},
{0xB7, 'x'},
{0xB8, 'y'},
{0xB9, 'z'},
// unused characters
{0xBA, 'à'},
{0xBB, 'è'},
{0xBC, 'é'},
{0xBD, 'ù'},
{0xBE, 'À'},
{0xBF, 'Á'}, // Used in Spanish FALCÁN in-game trade, inaccessible from keyboard
{0xC0, 'Ä'},
{0xC1, 'Ö'},
{0xC2, 'Ü'},
{0xC3, 'ä'},
{0xC4, 'ö'},
{0xC5, 'ü'},
// unused characters
{0xC6, 'È'},
{0xC7, 'É'},
{0xC8, 'Ì'},
{0xC9, 'Í'}, // Used in Spanish MANÍA in-game trade, inaccessible from keyboard
{0xCA, 'Ñ'},
{0xCB, 'Ò'},
{0xCC, 'Ó'},
{0xCD, 'Ù'},
{0xCE, 'Ú'},
{0xCF, 'á'},
{0xD0, 'ì'},
{0xD1, 'í'},
{0xD2, 'ñ'},
{0xD3, 'ò'},
{0xD4, 'ó'},
{0xD5, 'ú'},
{0xE0, ''},
{0xE1, '{'}, /* Pk */
{0xE2, '}'}, /* Mn */
{0xE3, '-'},
{0xE6, '?'},
{0xE7, '!'},
{0xE8, '.'}, // Alias decimal point to .
{0xEF, '♂'},
{0xF1, '×'},
{0xF2, '.'},
{0xF3, '/'},
{0xF4, ','},
{0xF5, '♀'},
{0xF6, '0'},
{0xF7, '1'},
{0xF8, '2'},
{0xF9, '3'},
{0xFA, '4'},
{0xFB, '5'},
{0xFC, '6'},
{0xFD, '7'},
{0xFE, '8'},
{0xFF, '9'},
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, // 00-0F
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, // 10-1F
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, // 20-2F
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, // 30-3F
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, // 40-4F
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, TOT, NUL, NUL, // 50-5F
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, // 60-6F
LPO, LKE, '“', '”', NUL, '…', NUL, NUL, NUL, '┌', '─', '┐', '│', '└', '┘', ' ', // 70-7F
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 80-8F
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '(', ')', ':', ';', '[', ']', // 90-9F
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', // A0-AF
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'à', 'è', 'é', 'ù', 'À', 'Á', // B0-BF
'Ä', 'Ö', 'Ü', 'ä', 'ö', 'ü', 'È', 'É', 'Ì', 'Í', 'Ñ', 'Ò', 'Ó', 'Ù', 'Ú', 'á', // C0-CF
'ì', 'í', 'ñ', 'ò', 'ó', 'ú', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, '←', '\'', // D0-DF
'', LPK, LMN, '-', NUL, NUL, '?', '!', '.', '&', LEA, '→', '▷', '▶', '▼', '♂', // E0-EF
MNY, '×', DOT, '/', ',', '♀', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', // F0-FF
};
private static readonly Dictionary<byte, char> RBY2U_J = new(180)
public static ReadOnlySpan<char> TableJP => new[]
{
{0x05, 'ガ'},
{0x06, 'ギ'},
{0x07, 'グ'},
{0x08, 'ゲ'},
{0x09, 'ゴ'},
{0x0A, 'ザ'},
{0x0B, 'ジ'},
{0x0C, 'ズ'},
{0x0D, 'ゼ'},
{0x0E, 'ゾ'},
{0x0F, 'ダ'},
{0x10, 'ヂ'},
{0x11, 'ヅ'},
{0x12, 'デ'},
{0x13, 'ド'},
{0x19, 'バ'},
{0x1A, 'ビ'},
{0x1B, 'ブ'},
{0x1C, 'ボ'},
{0x26, 'が'},
{0x27, 'ぎ'},
{0x28, 'ぐ'},
{0x29, 'げ'},
{0x2A, 'ご'},
{0x2B, 'ざ'},
{0x2C, 'じ'},
{0x2D, 'ず'},
{0x2E, 'ぜ'},
{0x2F, 'ぞ'},
{0x30, 'だ'},
{0x31, 'ぢ'},
{0x32, 'づ'},
{0x33, 'で'},
{0x34, 'ど'},
{0x3A, 'ば'},
{0x3B, 'び'},
{0x3C, 'ぶ'},
{0x3D, 'ベ'},
{0x3E, 'ぼ'},
{0x40, 'パ'},
{0x41, 'ピ'},
{0x42, 'プ'},
{0x43, 'ポ'},
{0x44, 'ぱ'},
{0x45, 'ぴ'},
{0x46, 'ぷ'},
{0x47, 'ペ'},
{0x48, 'ぽ'},
{0x50, G1Terminator},
{0x5D, G1TradeOT},
{0x7F, ' '},
{0x80, 'ア'},
{0x81, 'イ'},
{0x82, 'ウ'},
{0x83, 'エ'},
{0x84, 'オ'},
{0x85, 'カ'},
{0x86, 'キ'},
{0x87, 'ク'},
{0x88, 'ケ'},
{0x89, 'コ'},
{0x8A, 'サ'},
{0x8B, 'シ'},
{0x8C, 'ス'},
{0x8D, 'セ'},
{0x8E, 'ソ'},
{0x8F, 'タ'},
{0x90, 'チ'},
{0x91, 'ツ'},
{0x92, 'テ'},
{0x93, 'ト'},
{0x94, 'ナ'},
{0x95, 'ニ'},
{0x96, 'ヌ'},
{0x97, 'ネ'},
{0x98, ''},
{0x99, 'ハ'},
{0x9A, 'ヒ'},
{0x9B, 'フ'},
{0x9C, 'ホ'},
{0x9D, 'マ'},
{0x9E, 'ミ'},
{0x9F, 'ム'},
{0xA0, 'メ'},
{0xA1, 'モ'},
{0xA2, 'ヤ'},
{0xA3, 'ユ'},
{0xA4, 'ヨ'},
{0xA5, 'ラ'},
{0xA6, 'ル'},
{0xA7, 'レ'},
{0xA8, 'ロ'},
{0xA9, 'ワ'},
{0xAA, 'ヲ'},
{0xAB, 'ン'},
{0xAC, 'ッ'},
{0xAD, 'ャ'},
{0xAE, 'ュ'},
{0xAF, 'ョ'},
{0xB0, 'ィ'},
{0xB1, 'あ'},
{0xB2, 'い'},
{0xB3, 'う'},
{0xB4, 'え'},
{0xB5, 'お'},
{0xB6, 'か'},
{0xB7, 'き'},
{0xB8, 'く'},
{0xB9, 'け'},
{0xBA, 'こ'},
{0xBB, 'さ'},
{0xBC, 'し'},
{0xBD, 'す'},
{0xBE, 'せ'},
{0xBF, 'そ'},
{0xC0, 'た'},
{0xC1, 'ち'},
{0xC2, 'つ'},
{0xC3, 'て'},
{0xC4, 'と'},
{0xC5, 'な'},
{0xC6, 'に'},
{0xC7, 'ぬ'},
{0xC8, 'ね'},
{0xC9, 'の'},
{0xCA, 'は'},
{0xCB, 'ひ'},
{0xCC, 'ふ'},
{0xCD, 'へ'},
{0xCE, 'ほ'},
{0xCF, 'ま'},
{0xD0, 'み'},
{0xD1, 'む'},
{0xD2, 'め'},
{0xD3, 'も'},
{0xD4, 'や'},
{0xD5, 'ゆ'},
{0xD6, 'よ'},
{0xD7, 'ら'},
{0xD8, 'リ'},
{0xD9, 'る'},
{0xDA, 'れ'},
{0xDB, 'ろ'},
{0xDC, 'わ'},
{0xDD, 'を'},
{0xDE, 'ん'},
{0xDF, 'っ'},
{0xE0, 'ゃ'},
{0xE1, 'ゅ'},
{0xE2, 'ょ'},
{0xE3, 'ー'},
{0xE6, '?'},
{0xE7, '!'},
{0xE9, 'ァ'},
{0xEA, 'ゥ'},
{0xEB, 'ェ'},
{0xEF, '♂'},
{0xF4, 'ォ'},
{0xF5, '♀'},
{0xF6, '0'},
{0xF7, '1'},
{0xF8, '2'},
{0xF9, '3'},
{0xFA, '4'},
{0xFB, '5'},
{0xFC, '6'},
{0xFD, '7'},
{0xFE, '8'},
{0xFF, '9'},
};
internal static readonly Dictionary<char, byte> U2RBY_U = new(120)
{
{G1Terminator, 0x50},
{G1TradeOT, 0x5D}, // TRAINER (Localized per ROM)
{' ', 0x7F},
{'A', 0x80},
{'B', 0x81},
{'C', 0x82},
{'D', 0x83},
{'E', 0x84},
{'F', 0x85},
{'G', 0x86},
{'H', 0x87},
{'I', 0x88},
{'J', 0x89},
{'K', 0x8A},
{'L', 0x8B},
{'M', 0x8C},
{'N', 0x8D},
{'O', 0x8E},
{'P', 0x8F},
{'Q', 0x90},
{'R', 0x91},
{'S', 0x92},
{'T', 0x93},
{'U', 0x94},
{'V', 0x95},
{'W', 0x96},
{'X', 0x97},
{'Y', 0x98},
{'Z', 0x99},
{'(', 0x9A},
{')', 0x9B},
{':', 0x9C},
{';', 0x9D},
{'[', 0x9E},
{']', 0x9F},
{'a', 0xA0},
{'b', 0xA1},
{'c', 0xA2},
{'d', 0xA3},
{'e', 0xA4},
{'f', 0xA5},
{'g', 0xA6},
{'h', 0xA7},
{'i', 0xA8},
{'j', 0xA9},
{'k', 0xAA},
{'l', 0xAB},
{'m', 0xAC},
{'n', 0xAD},
{'o', 0xAE},
{'p', 0xAF},
{'q', 0xB0},
{'r', 0xB1},
{'s', 0xB2},
{'t', 0xB3},
{'u', 0xB4},
{'v', 0xB5},
{'w', 0xB6},
{'x', 0xB7},
{'y', 0xB8},
{'z', 0xB9},
// unused characters
{'à', 0xBA},
{'è', 0xBB},
{'é', 0xBC},
{'ù', 0xBD},
{'À', 0xBE},
{'Á', 0xBF}, // Used in Spanish FALCÁN in-game trade, inaccessible from keyboard
{'Ä', 0xC0},
{'Ö', 0xC1},
{'Ü', 0xC2},
{'ä', 0xC3},
{'ö', 0xC4},
{'ü', 0xC5},
// unused characters
{'È', 0xC6},
{'É', 0xC7},
{'Ì', 0xC8},
{'Í', 0xC9}, // Used in Spanish MANÍA in-game trade, inaccessible from keyboard
{'Ñ', 0xCA},
{'Ò', 0xCB},
{'Ó', 0xCC},
{'Ù', 0xCD},
{'Ú', 0xCE},
{'á', 0xCF},
{'ì', 0xD0},
{'í', 0xD1},
{'ñ', 0xD2},
{'ò', 0xD3},
{'ó', 0xD4},
{'ú', 0xD5},
{'\'', 0xE0}, // Alias ' to for Farfetchd
{'', 0xE0},
{'{', 0xE1}, /* Pk */
{'}', 0xE2}, /* Mn */
{'-', 0xE3},
{'?', 0xE6},
{'!', 0xE7},
{'♂', 0xEF},
{'×', 0xF1},
{'.', 0xF2},
{'/', 0xF3},
{',', 0xF4},
{'♀', 0xF5},
{'0', 0xF6},
{'1', 0xF7},
{'2', 0xF8},
{'3', 0xF9},
{'4', 0xFA},
{'5', 0xFB},
{'6', 0xFC},
{'7', 0xFD},
{'8', 0xFE},
{'9', 0xFF},
};
private static readonly Dictionary<char, byte> U2RBY_J = new(180)
{
{'ガ', 0x05},
{'ギ', 0x06},
{'グ', 0x07},
{'ゲ', 0x08},
{'ゴ', 0x09},
{'ザ', 0x0A},
{'ジ', 0x0B},
{'ズ', 0x0C},
{'ゼ', 0x0D},
{'ゾ', 0x0E},
{'ダ', 0x0F},
{'ヂ', 0x10},
{'ヅ', 0x11},
{'デ', 0x12},
{'ド', 0x13},
{'バ', 0x19},
{'ビ', 0x1A},
{'ブ', 0x1B},
{'ボ', 0x1C},
{'が', 0x26},
{'ぎ', 0x27},
{'ぐ', 0x28},
{'げ', 0x29},
{'ご', 0x2A},
{'ざ', 0x2B},
{'じ', 0x2C},
{'ず', 0x2D},
{'ぜ', 0x2E},
{'ぞ', 0x2F},
{'だ', 0x30},
{'ぢ', 0x31},
{'づ', 0x32},
{'で', 0x33},
{'ど', 0x34},
{'ば', 0x3A},
{'び', 0x3B},
{'ぶ', 0x3C},
{'ベ', 0x3D},
{'べ', 0x3D},
{'ぼ', 0x3E},
{'パ', 0x40},
{'ピ', 0x41},
{'プ', 0x42},
{'ポ', 0x43},
{'ぱ', 0x44},
{'ぴ', 0x45},
{'ぷ', 0x46},
{'ぺ', 0x47},
{'ペ', 0x47},
{'ぽ', 0x48},
{G1Terminator, 0x50},
{G1TradeOT, 0x5D}, // トレーナー, (Localized per ROM)
{' ', 0x7F},
{'ア', 0x80},
{'イ', 0x81},
{'ウ', 0x82},
{'エ', 0x83},
{'オ', 0x84},
{'カ', 0x85},
{'キ', 0x86},
{'ク', 0x87},
{'ケ', 0x88},
{'コ', 0x89},
{'サ', 0x8A},
{'シ', 0x8B},
{'ス', 0x8C},
{'セ', 0x8D},
{'ソ', 0x8E},
{'タ', 0x8F},
{'チ', 0x90},
{'ツ', 0x91},
{'テ', 0x92},
{'ト', 0x93},
{'ナ', 0x94},
{'ニ', 0x95},
{'ヌ', 0x96},
{'ネ', 0x97},
{'', 0x98},
{'ハ', 0x99},
{'ヒ', 0x9A},
{'フ', 0x9B},
{'ホ', 0x9C},
{'マ', 0x9D},
{'ミ', 0x9E},
{'ム', 0x9F},
{'メ', 0xA0},
{'モ', 0xA1},
{'ヤ', 0xA2},
{'ユ', 0xA3},
{'ヨ', 0xA4},
{'ラ', 0xA5},
{'ル', 0xA6},
{'レ', 0xA7},
{'ロ', 0xA8},
{'ワ', 0xA9},
{'ヲ', 0xAA},
{'ン', 0xAB},
{'ッ', 0xAC},
{'ャ', 0xAD},
{'ュ', 0xAE},
{'ョ', 0xAF},
{'ィ', 0xB0},
{'あ', 0xB1},
{'い', 0xB2},
{'う', 0xB3},
{'え', 0xB4},
{'お', 0xB5},
{'か', 0xB6},
{'き', 0xB7},
{'く', 0xB8},
{'け', 0xB9},
{'こ', 0xBA},
{'さ', 0xBB},
{'し', 0xBC},
{'す', 0xBD},
{'せ', 0xBE},
{'そ', 0xBF},
{'た', 0xC0},
{'ち', 0xC1},
{'つ', 0xC2},
{'て', 0xC3},
{'と', 0xC4},
{'な', 0xC5},
{'に', 0xC6},
{'ぬ', 0xC7},
{'ね', 0xC8},
{'の', 0xC9},
{'は', 0xCA},
{'ひ', 0xCB},
{'ふ', 0xCC},
{'へ', 0xCD},
{'ヘ', 0xCD}, // Katakana ヘ => Hiragana へ
{'ほ', 0xCE},
{'ま', 0xCF},
{'み', 0xD0},
{'む', 0xD1},
{'め', 0xD2},
{'も', 0xD3},
{'や', 0xD4},
{'ゆ', 0xD5},
{'よ', 0xD6},
{'ら', 0xD7},
{'リ', 0xD8},
{'り', 0xD8},
{'る', 0xD9},
{'れ', 0xDA},
{'ろ', 0xDB},
{'わ', 0xDC},
{'を', 0xDD},
{'ん', 0xDE},
{'っ', 0xDF},
{'ゃ', 0xE0},
{'ゅ', 0xE1},
{'ょ', 0xE2},
{'ー', 0xE3},
{'?', 0xE6},
{'!', 0xE7},
{'ァ', 0xE9},
{'ゥ', 0xEA},
{'ェ', 0xEB},
{'♂', 0xEF},
{'ォ', 0xF4},
{'♀', 0xF5},
{'0', 0xF6},
{'1', 0xF7},
{'2', 0xF8},
{'3', 0xF9},
{'4', 0xFA},
{'5', 0xFB},
{'6', 0xFC},
{'7', 0xFD},
{'8', 0xFE},
{'9', 0xFF},
NUL, NUL, NUL, NUL, NUL, 'ガ', 'ギ', 'グ', 'ゲ', 'ゴ', 'ザ', 'ジ', 'ズ', 'ゼ', 'ゾ', 'ダ', // 00-0F
'ヂ', 'ヅ', 'デ', 'ド', NUL, NUL, NUL, NUL, NUL, 'バ', 'ビ', 'ブ', 'ボ', NUL, NUL, NUL, // 10-1F
NUL, NUL, NUL, NUL, NUL, NUL, 'が', 'ぎ', 'ぐ', 'げ', 'ご', 'ざ', 'じ', 'ず', 'ぜ', 'ぞ', // 20-2F
'だ', 'ぢ', 'づ', 'で', 'ど', NUL, NUL, NUL, NUL, NUL, 'ば', 'び', 'ぶ', 'ベ', 'ぼ', NUL, // 30-3F
'パ', 'ピ', 'プ', 'ポ', 'ぱ', 'ぴ', 'ぷ', 'ペ', 'ぽ', NUL, NUL, NUL, NUL, NUL, NUL, NUL, // 40-4F
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, TOT, NUL, NUL, // 50-5F
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, // 60-6F
'「', '」', '『', '』', '・', '⋯', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, ' ', // 70-7F
'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', 'タ', // 80-8F
'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', '', 'ハ', 'ヒ', 'フ', 'ホ', 'マ', 'ミ', 'ム', // 90-9F
'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'ル', 'レ', 'ロ', 'ワ', 'ヲ', 'ン', 'ッ', 'ャ', 'ュ', 'ョ', // A0-AF
'ィ', 'あ', 'い', 'う', 'え', 'お', 'か', 'き', 'く', 'け', 'こ', 'さ', 'し', 'す', 'せ', 'そ', // B0-BF
'た', 'ち', 'つ', 'て', 'と', 'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ひ', 'ふ', 'ヘ', 'ほ', 'ま', // C0-CF
'み', 'む', 'め', 'も', 'や', 'ゆ', 'よ', 'ら', 'リ', 'る', 'れ', 'ろ', 'わ', 'を', 'ん', 'っ', // D0-DF
'ゃ', 'ゅ', 'ょ', 'ー', '゚', '゙', '', '', '。', 'ァ', 'ゥ', 'ェ', NUL, NUL, NUL, '♂', // E0-EF
MNY, NUL, '', '', 'ォ', '♀', '', '', '', '', '', '', '', '', '', '', // F0-FF
};
#endregion

View file

@ -120,6 +120,7 @@ public static class StringConverter12Transporter
/// <summary>
/// Japanese 1/2->7 character translation table
/// </summary>
/// <remarks>Full-width 0-9 removed from the Japanese table as these glyphs are inaccessible via the character entry screen.</remarks>
private static ReadOnlySpan<ushort> CharTableJPN => new ushort[]
{
0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x30AC, 0x30AE, 0x30B0, 0x30B2, 0x30B4, 0x30B6, 0x30B8, 0x30BA, 0x30BC, 0x30BE, 0x30C0, // 0
@ -139,4 +140,16 @@ public static class StringConverter12Transporter
0x3083, 0x3085, 0x3087, 0x30FC, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x30A1, 0x30A5, 0x30A7, 0x3000, 0x3000, 0x3000, 0x2642, // E
0x3000, 0x3000, 0x3000, 0x3000, 0x30A9, 0x2640, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, // F
};
public static string GetTradeNameGen1(int language) => language switch
{
1 => "トレーナー",
2 => "Trainer",
3 => "Dresseur",
4 => "Allenatore",
5 => "Trainer",
7 => "Entrenador",
//8 => "트레이너",
_ => string.Empty,
};
}

View file

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using static PKHeX.Core.StringConverter12;
@ -15,18 +14,9 @@ public static class StringConverter2KOR
/// </summary>
public static bool GetIsG2Korean(ReadOnlySpan<char> str)
{
var all = U2GSC_KOR;
foreach (var c in str)
{
bool any = false;
foreach (var dict in all)
{
if (!dict.ContainsKey(c))
continue;
any = true;
break;
}
if (!any)
if (!IsKoreanChar(c))
return false;
}
return true;
@ -61,11 +51,23 @@ public static class StringConverter2KOR
for (; i < data.Length; i++)
{
var value = data[i];
var table = value <= 0xB ? GSC2U_KOR[value] : RBY2U_U;
if (value is <= 0xB and not 0)
value = data[++i];
if (!table.TryGetValue(value, out var c)) // Take valid values
if (value == TableInvalid) // Don't bother.
break;
ReadOnlySpan<char> table;
if (value > TableMax)
{
table = Table0;
}
else
{
if (++i == data.Length)
break;
table = GetTable(value);
value = data[i];
}
var c = table[value];
if (c == G1Terminator) // Stop if Terminator
break;
result[ctr++] = c;
@ -99,40 +101,62 @@ public static class StringConverter2KOR
if (value.Length > maxLength)
value = value[..maxLength]; // Hard cap
var kor = U2GSC_KOR;
var dict = U2RBY_U;
int ctr = 0;
foreach (var c in value)
{
var koreanChar = false;
// although the 0x00 and 0x0B dictionaries are identical, the game only uses 0x0B.
for (byte t = 1; t < kor.Length; t++)
{
var table = kor[t];
if (!table.TryGetValue(c, out byte val))
continue;
koreanChar = true;
if (ctr + 2 > destBuffer.Length)
break; // adding 2 characters will overflow requested buffer cap
destBuffer[ctr++] = t;
destBuffer[ctr++] = val;
break;
}
if (!koreanChar)
{
if (!dict.TryGetValue(c, out byte val))
break;
destBuffer[ctr++] = val;
}
}
int ctr = LoadCharacters(destBuffer, value);
if (ctr < value.Length)
destBuffer[ctr++] = G1TerminatorCode;
return ctr;
}
private static int LoadCharacters(Span<byte> destBuffer, ReadOnlySpan<char> value)
{
int ctr = 0;
foreach (var c in value)
{
var (table, val) = GetKoreanChar(c);
if (table != TableInvalid)
{
if (ctr + 2 > destBuffer.Length)
break; // adding 2 characters will overflow requested buffer cap
destBuffer[ctr++] = table;
destBuffer[ctr++] = val;
}
else
{
var index = Table0.IndexOf(c);
if (index is -1 or G1TerminatorCode)
break;
if (ctr + 1 > destBuffer.Length)
break; // adding 1 character will overflow requested buffer cap
destBuffer[ctr++] = (byte)index;
}
}
return ctr;
}
private static (byte Table, byte Value) GetKoreanChar(char c)
{
for (var t = TableMin; t <= TableMax; t++)
{
var table = GetTable(t);
var index = table.IndexOf(c);
if (index != -1)
return (t, (byte)index);
}
return default;
}
private static bool IsKoreanChar(char c)
{
for (var t = TableMin; t <= TableMax; t++)
{
var table = GetTable(t);
var index = table.IndexOf(c);
if (index != -1)
return true;
}
return false;
}
/// <summary>
/// Localizes a Gen4+ Korean species name to the localization used in Generation 2 Gold/Silver
/// </summary>
@ -148,426 +172,267 @@ public static class StringConverter2KOR
}
#region Gen 2 Korean Character Tables
private static readonly Dictionary<char, byte> U2GSC_KOR_0 = new(256)
private const char NULL = G1Terminator;
private const byte TableInvalid = 0;
private const byte TableMin = 1;
private const byte TableMax = 11;
private static ReadOnlySpan<char> GetTable(byte table) => table switch
{
{'ㄱ', 0x00}, {'ㄴ', 0x01}, {'ㄷ', 0x02}, {'ㄹ', 0x03}, {'ㅁ', 0x04}, {'ㅂ', 0x05}, {'ㅅ', 0x06}, {'ㅇ', 0x07}, {'ㅈ', 0x08}, {'ㅊ', 0x09}, {'ㅋ', 0x0A}, {'ㅌ', 0x0B}, {'ㅍ', 0x0C}, {'ㅎ', 0x0D}, {'ㄲ', 0x0E}, {'ㄸ', 0x0F},
{'ㅃ', 0x10}, {'ㅆ', 0x11}, {'ㅉ', 0x12},
{'ㅏ', 0x20}, {'ㅑ', 0x21}, {'ㅓ', 0x22}, {'ㅕ', 0x23}, {'ㅗ', 0x24}, {'ㅛ', 0x25}, {'ㅜ', 0x26}, {'ㅠ', 0x27}, {'ㅡ', 0x28}, {'ㅣ', 0x29}, {'ㅐ', 0x2A}, {'ㅒ', 0x2B}, {'ㅔ', 0x2C}, {'ㅖ', 0x2D}, {'ㅘ', 0x2E}, {'ㅙ', 0x2F},
{'ㅚ', 0x30}, {'ㅝ', 0x31}, {'ㅞ', 0x32}, {'ㅟ', 0x33}, {'ㅢ', 0x34}, {'_', 0x3E}, {'—', 0x3F},
{'「', 0x60}, {'」', 0x61}, {'『', 0x62}, {'』', 0x63}, {'(', 0x64}, {')', 0x65}, {'!', 0x66}, {'?', 0x67}, {'-', 0x68}, {'~', 0x69}, {'…', 0x6A}, {',', 0x6B}, {'.', 0x6C}, // . is 0x6D for bank
{'', 0xF0}, {'', 0xF1}, {'', 0xF2}, {'', 0xF3}, {'', 0xF4}, {'', 0xF5}, {'', 0xF6}, {'', 0xF7}, {'', 0xF8}, {'', 0xF9},
{'\u3000', 0xFF},
0x01 => Table1,
0x02 => Table2,
0x03 => Table3,
0x04 => Table4,
0x05 => Table5,
0x06 => Table6,
0x07 => Table7,
0x08 => Table8,
0x09 => Table9,
0x0A => TableA,
0x0B => TableB,
_ => throw new ArgumentOutOfRangeException(nameof(table)),
};
private static readonly Dictionary<char, byte> U2GSC_KOR_1 = new(256)
private static ReadOnlySpan<char> Table1 => new[]
{
{'가', 0x01}, {'각', 0x02}, {'간', 0x03}, {'갇', 0x04}, {'갈', 0x05}, {'갉', 0x06}, {'갊', 0x07}, {'감', 0x08}, {'갑', 0x09}, {'값', 0x0A}, {'갓', 0x0B}, {'갔', 0x0C}, {'강', 0x0D}, {'갖', 0x0E}, {'갗', 0x0F},
{'같', 0x10}, {'갚', 0x11}, {'갛', 0x12}, {'개', 0x13}, {'객', 0x14}, {'갠', 0x15}, {'갤', 0x16}, {'갬', 0x17}, {'갭', 0x18}, {'갯', 0x19}, {'갰', 0x1A}, {'갱', 0x1B}, {'갸', 0x1C}, {'갹', 0x1D}, {'갼', 0x1E}, {'걀', 0x1F},
{'걋', 0x20}, {'걍', 0x21}, {'걔', 0x22}, {'걘', 0x23}, {'걜', 0x24}, {'거', 0x25}, {'걱', 0x26}, {'건', 0x27}, {'걷', 0x28}, {'걸', 0x29}, {'걺', 0x2A}, {'검', 0x2B}, {'겁', 0x2C}, {'것', 0x2D}, {'겄', 0x2E}, {'겅', 0x2F},
{'겆', 0x30}, {'겉', 0x31}, {'겊', 0x32}, {'겋', 0x33}, {'게', 0x34}, {'겐', 0x35}, {'겔', 0x36}, {'겜', 0x37}, {'겝', 0x38}, {'겟', 0x39}, {'겠', 0x3A}, {'겡', 0x3B}, {'겨', 0x3C}, {'격', 0x3D}, {'겪', 0x3E}, {'견', 0x3F},
{'겯', 0x40}, {'결', 0x41}, {'겹', 0x42}, {'겸', 0x43}, {'겻', 0x44}, {'겼', 0x45}, {'경', 0x46}, {'곁', 0x47}, {'계', 0x48}, {'곈', 0x49}, {'곌', 0x4A}, {'곕', 0x4B}, {'곗', 0x4C}, {'고', 0x4D}, {'곡', 0x4E}, {'곤', 0x4F},
{'곧', 0x60}, {'골', 0x61}, {'곪', 0x62}, {'곬', 0x63}, {'곯', 0x64}, {'곰', 0x65}, {'곱', 0x66}, {'곳', 0x67}, {'공', 0x68}, {'곶', 0x69}, {'과', 0x6A}, {'곽', 0x6B}, {'관', 0x6C}, {'괄', 0x6D}, {'괆', 0x6E},
{'괌', 0x71}, {'괍', 0x72}, {'괏', 0x73}, {'광', 0x74}, {'괘', 0x75}, {'괜', 0x76}, {'괠', 0x77}, {'괩', 0x78}, {'괬', 0x79}, {'괭', 0x7A}, {'괴', 0x7B}, {'괵', 0x7C}, {'괸', 0x7D}, {'괼', 0x7E}, {'괻', 0x7F},
{'굅', 0x80}, {'굇', 0x81}, {'굉', 0x82}, {'교', 0x83}, {'굔', 0x84}, {'굘', 0x85}, {'굡', 0x86}, {'굣', 0x87}, {'구', 0x88}, {'국', 0x89}, {'군', 0x8A}, {'굳', 0x8B}, {'굴', 0x8C}, {'굵', 0x8D}, {'굶', 0x8E}, {'굻', 0x8F},
{'굼', 0x90}, {'굽', 0x91}, {'굿', 0x92}, {'궁', 0x93}, {'궂', 0x94}, {'궈', 0x95}, {'궉', 0x96}, {'권', 0x97}, {'궐', 0x98}, {'궜', 0x99}, {'궝', 0x9A}, {'궤', 0x9B}, {'궷', 0x9C}, {'귀', 0x9D}, {'귁', 0x9E}, {'귄', 0x9F},
{'귈', 0xA0}, {'귐', 0xA1}, {'귑', 0xA2}, {'귓', 0xA3}, {'규', 0xA4}, {'균', 0xA5}, {'귤', 0xA6}, {'그', 0xA7}, {'극', 0xA8}, {'근', 0xA9}, {'귿', 0xAA}, {'글', 0xAB}, {'긁', 0xAC}, {'금', 0xAD}, {'급', 0xAE}, {'긋', 0xAF},
{'긍', 0xB0}, {'긔', 0xB1}, {'기', 0xB2}, {'긱', 0xB3}, {'긴', 0xB4}, {'긷', 0xB5}, {'길', 0xB6}, {'긺', 0xB7}, {'김', 0xB8}, {'깁', 0xB9}, {'깃', 0xBA}, {'깅', 0xBB}, {'깆', 0xBC}, {'깊', 0xBD}, {'까', 0xBE}, {'깍', 0xBF},
{'깎', 0xC0}, {'깐', 0xC1}, {'깔', 0xC2}, {'깖', 0xC3}, {'깜', 0xC4}, {'깝', 0xC5}, {'깟', 0xC6}, {'깠', 0xC7}, {'깡', 0xC8}, {'깥', 0xC9}, {'깨', 0xCA}, {'깩', 0xCB}, {'깬', 0xCC}, {'깰', 0xCD}, {'깸', 0xCE},
{'깹', 0xD1}, {'깻', 0xD2}, {'깼', 0xD3}, {'깽', 0xD4}, {'꺄', 0xD5}, {'꺅', 0xD6}, {'꺌', 0xD7}, {'꺼', 0xD8}, {'꺽', 0xD9}, {'꺾', 0xDA}, {'껀', 0xDB}, {'껄', 0xDC}, {'껌', 0xDD}, {'껍', 0xDE}, {'껏', 0xDF},
{'껐', 0xE0}, {'껑', 0xE1}, {'께', 0xE2}, {'껙', 0xE3}, {'껜', 0xE4}, {'껨', 0xE5}, {'껫', 0xE6}, {'껭', 0xE7}, {'껴', 0xE8}, {'껸', 0xE9}, {'껼', 0xEA}, {'꼇', 0xEB}, {'꼈', 0xEC}, {'꼍', 0xED}, {'꼐', 0xEE}, {'꼬', 0xEF},
{'꼭', 0xF0}, {'꼰', 0xF1}, {'꼲', 0xF2}, {'꼴', 0xF3}, {'꼼', 0xF4}, {'꼽', 0xF5}, {'꼿', 0xF6}, {'꽁', 0xF7}, {'꽂', 0xF8}, {'꽃', 0xF9}, {'꽈', 0xFA}, {'꽉', 0xFB}, {'꽐', 0xFC}, {'꽜', 0xFD}, {'꽝', 0xFE}, {'꽤', 0xFF},
NULL, '가', '각', '간', '갇', '갈', '갉', '갊', '감', '갑', '값', '갓', '갔', '강', '갖', '갗',
'같', '갚', '갛', '개', '객', '갠', '갤', '갬', '갭', '갯', '갰', '갱', '갸', '갹', '갼', '걀',
'걋', '걍', '걔', '걘', '걜', '거', '걱', '건', '걷', '걸', '걺', '검', '겁', '것', '겄', '겅',
'겆', '겉', '겊', '겋', '게', '겐', '겔', '겜', '겝', '겟', '겠', '겡', '겨', '격', '겪', '견',
'겯', '결', '겹', '겸', '겻', '겼', '경', '곁', '계', '곈', '곌', '곕', '곗', '고', '곡', '곤',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'곧', '골', '곪', '곬', '곯', '곰', '곱', '곳', '공', '곶', '과', '곽', '관', '괄', '괆', NULL,
NULL, '괌', '괍', '괏', '광', '괘', '괜', '괠', '괩', '괬', '괭', '괴', '괵', '괸', '괼', '괻',
'굅', '굇', '굉', '교', '굔', '굘', '굡', '굣', '구', '국', '군', '굳', '굴', '굵', '굶', '굻',
'굼', '굽', '굿', '궁', '궂', '궈', '궉', '권', '궐', '궜', '궝', '궤', '궷', '귀', '귁', '귄',
'귈', '귐', '귑', '귓', '규', '균', '귤', '그', '극', '근', '귿', '글', '긁', '금', '급', '긋',
'긍', '긔', '기', '긱', '긴', '긷', '길', '긺', '김', '깁', '깃', '깅', '깆', '깊', '까', '깍',
'깎', '깐', '깔', '깖', '깜', '깝', '깟', '깠', '깡', '깥', '깨', '깩', '깬', '깰', '깸', NULL,
NULL, '깹', '깻', '깼', '깽', '꺄', '꺅', '꺌', '꺼', '꺽', '꺾', '껀', '껄', '껌', '껍', '껏',
'껐', '껑', '께', '껙', '껜', '껨', '껫', '껭', '껴', '껸', '껼', '꼇', '꼈', '꼍', '꼐', '꼬',
'꼭', '꼰', '꼲', '꼴', '꼼', '꼽', '꼿', '꽁', '꽂', '꽃', '꽈', '꽉', '꽐', '꽜', '꽝', '꽤',
};
private static readonly Dictionary<char, byte> U2GSC_KOR_2 = new(256)
private static ReadOnlySpan<char> Table2 => new[]
{
{'꽥', 0x00}, {'꽹', 0x01}, {'꾀', 0x02}, {'꾄', 0x03}, {'꾈', 0x04}, {'꾐', 0x05}, {'꾑', 0x06}, {'꾕', 0x07}, {'꾜', 0x08}, {'꾸', 0x09}, {'꾹', 0x0A}, {'꾼', 0x0B}, {'꿀', 0x0C}, {'꿇', 0x0D}, {'꿈', 0x0E}, {'꿉', 0x0F},
{'꿋', 0x10}, {'꿍', 0x11}, {'꿎', 0x12}, {'꿔', 0x13}, {'꿜', 0x14}, {'꿨', 0x15}, {'꿩', 0x16}, {'꿰', 0x17}, {'꿱', 0x18}, {'꿴', 0x19}, {'꿸', 0x1A}, {'뀀', 0x1B}, {'뀁', 0x1C}, {'뀄', 0x1D}, {'뀌', 0x1E}, {'뀐', 0x1F},
{'뀔', 0x20}, {'뀜', 0x21}, {'뀝', 0x22}, {'뀨', 0x23}, {'끄', 0x24}, {'끅', 0x25}, {'끈', 0x26}, {'끊', 0x27}, {'끌', 0x28}, {'끎', 0x29}, {'끓', 0x2A}, {'끔', 0x2B}, {'끕', 0x2C}, {'끗', 0x2D}, {'끙', 0x2E},
{'끝', 0x31}, {'끼', 0x32}, {'끽', 0x33}, {'낀', 0x34}, {'낄', 0x35}, {'낌', 0x36}, {'낍', 0x37}, {'낏', 0x38}, {'낑', 0x39}, {'나', 0x3A}, {'낙', 0x3B}, {'낚', 0x3C}, {'난', 0x3D}, {'낟', 0x3E}, {'날', 0x3F},
{'낡', 0x40}, {'낢', 0x41}, {'남', 0x42}, {'납', 0x43}, {'낫', 0x44}, {'났', 0x45}, {'낭', 0x46}, {'낮', 0x47}, {'낯', 0x48}, {'낱', 0x49}, {'낳', 0x4A}, {'내', 0x4B}, {'낵', 0x4C}, {'낸', 0x4D}, {'낼', 0x4E}, {'냄', 0x4F},
{'냅', 0x60}, {'냇', 0x61}, {'냈', 0x62}, {'냉', 0x63}, {'냐', 0x64}, {'냑', 0x65}, {'냔', 0x66}, {'냘', 0x67}, {'냠', 0x68}, {'냥', 0x69}, {'너', 0x6A}, {'넉', 0x6B}, {'넋', 0x6C}, {'넌', 0x6D}, {'널', 0x6E}, {'넒', 0x6F},
{'넓', 0x70}, {'넘', 0x71}, {'넙', 0x72}, {'넛', 0x73}, {'넜', 0x74}, {'넝', 0x75}, {'넣', 0x76}, {'네', 0x77}, {'넥', 0x78}, {'넨', 0x79}, {'넬', 0x7A}, {'넴', 0x7B}, {'넵', 0x7C}, {'넷', 0x7D}, {'넸', 0x7E}, {'넹', 0x7F},
{'녀', 0x80}, {'녁', 0x81}, {'년', 0x82}, {'녈', 0x83}, {'념', 0x84}, {'녑', 0x85}, {'녔', 0x86}, {'녕', 0x87}, {'녘', 0x88}, {'녜', 0x89}, {'녠', 0x8A}, {'노', 0x8B}, {'녹', 0x8C}, {'논', 0x8D}, {'놀', 0x8E}, {'놂', 0x8F},
{'놈', 0x90}, {'놉', 0x91}, {'놋', 0x92}, {'농', 0x93}, {'높', 0x94}, {'놓', 0x95}, {'놔', 0x96}, {'놘', 0x97}, {'놜', 0x98}, {'놨', 0x99}, {'뇌', 0x9A}, {'뇐', 0x9B}, {'뇔', 0x9C}, {'뇜', 0x9D}, {'뇝', 0x9E},
{'뇟', 0xA1}, {'뇨', 0xA2}, {'뇩', 0xA3}, {'뇬', 0xA4}, {'뇰', 0xA5}, {'뇹', 0xA6}, {'뇻', 0xA7}, {'뇽', 0xA8}, {'누', 0xA9}, {'눅', 0xAA}, {'눈', 0xAB}, {'눋', 0xAC}, {'눌', 0xAD}, {'눔', 0xAE}, {'눕', 0xAF},
{'눗', 0xB0}, {'눙', 0xB1}, {'눠', 0xB2}, {'눴', 0xB3}, {'눼', 0xB4}, {'뉘', 0xB5}, {'뉜', 0xB6}, {'뉠', 0xB7}, {'뉨', 0xB8}, {'뉩', 0xB9}, {'뉴', 0xBA}, {'뉵', 0xBB}, {'뉼', 0xBC}, {'늄', 0xBD}, {'늅', 0xBE}, {'늉', 0xBF},
{'느', 0xC0}, {'늑', 0xC1}, {'는', 0xC2}, {'늘', 0xC3}, {'늙', 0xC4}, {'늚', 0xC5}, {'늠', 0xC6}, {'늡', 0xC7}, {'늣', 0xC8}, {'능', 0xC9}, {'늦', 0xCA}, {'늪', 0xCB}, {'늬', 0xCC}, {'늰', 0xCD}, {'늴', 0xCE}, {'니', 0xCF},
{'닉', 0xD0}, {'닌', 0xD1}, {'닐', 0xD2}, {'닒', 0xD3}, {'님', 0xD4}, {'닙', 0xD5}, {'닛', 0xD6}, {'닝', 0xD7}, {'닢', 0xD8}, {'다', 0xD9}, {'닥', 0xDA}, {'닦', 0xDB}, {'단', 0xDC}, {'닫', 0xDD}, {'달', 0xDE}, {'닭', 0xDF},
{'닮', 0xE0}, {'닯', 0xE1}, {'닳', 0xE2}, {'담', 0xE3}, {'답', 0xE4}, {'닷', 0xE5}, {'닸', 0xE6}, {'당', 0xE7}, {'닺', 0xE8}, {'닻', 0xE9}, {'닿', 0xEA}, {'대', 0xEB}, {'댁', 0xEC}, {'댄', 0xED}, {'댈', 0xEE}, {'댐', 0xEF},
{'댑', 0xF0}, {'댓', 0xF1}, {'댔', 0xF2}, {'댕', 0xF3}, {'더', 0xF5}, {'덕', 0xF6}, {'덖', 0xF7}, {'던', 0xF8}, {'덛', 0xF9}, {'덜', 0xFA}, {'덞', 0xFB}, {'덟', 0xFC}, {'덤', 0xFD}, {'덥', 0xFE},
'꽥', '꽹', '꾀', '꾄', '꾈', '꾐', '꾑', '꾕', '꾜', '꾸', '꾹', '꾼', '꿀', '꿇', '꿈', '꿉',
'꿋', '꿍', '꿎', '꿔', '꿜', '꿨', '꿩', '꿰', '꿱', '꿴', '꿸', '뀀', '뀁', '뀄', '뀌', '뀐',
'뀔', '뀜', '뀝', '뀨', '끄', '끅', '끈', '끊', '끌', '끎', '끓', '끔', '끕', '끗', '끙', NULL,
NULL, '끝', '끼', '끽', '낀', '낄', '낌', '낍', '낏', '낑', '나', '낙', '낚', '난', '낟', '날',
'낡', '낢', '남', '납', '낫', '났', '낭', '낮', '낯', '낱', '낳', '내', '낵', '낸', '낼', '냄',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'냅', '냇', '냈', '냉', '냐', '냑', '냔', '냘', '냠', '냥', '너', '넉', '넋', '넌', '널', '넒',
'넓', '넘', '넙', '넛', '넜', '넝', '넣', '네', '넥', '넨', '넬', '넴', '넵', '넷', '넸', '넹',
'녀', '녁', '년', '녈', '념', '녑', '녔', '녕', '녘', '녜', '녠', '노', '녹', '논', '놀', '놂',
'놈', '놉', '놋', '농', '높', '놓', '놔', '놘', '놜', '놨', '뇌', '뇐', '뇔', '뇜', '뇝', NULL,
NULL, '뇟', '뇨', '뇩', '뇬', '뇰', '뇹', '뇻', '뇽', '누', '눅', '눈', '눋', '눌', '눔', '눕',
'눗', '눙', '눠', '눴', '눼', '뉘', '뉜', '뉠', '뉨', '뉩', '뉴', '뉵', '뉼', '늄', '늅', '늉',
'느', '늑', '는', '늘', '늙', '늚', '늠', '늡', '늣', '능', '늦', '늪', '늬', '늰', '늴', '니',
'닉', '닌', '닐', '닒', '님', '닙', '닛', '닝', '닢', '다', '닥', '닦', '단', '닫', '달', '닭',
'닮', '닯', '닳', '담', '답', '닷', '닸', '당', '닺', '닻', '닿', '대', '댁', '댄', '댈', '댐',
'댑', '댓', '댔', '댕', NULL, '더', '덕', '덖', '던', '덛', '덜', '덞', '덟', '덤', '덥', NULL,
};
private static readonly Dictionary<char, byte> U2GSC_KOR_3 = new(256)
private static ReadOnlySpan<char> Table3 => new[]
{
{'덧', 0x01}, {'덩', 0x02}, {'덫', 0x03}, {'덮', 0x04}, {'데', 0x05}, {'덱', 0x06}, {'덴', 0x07}, {'델', 0x08}, {'뎀', 0x09}, {'뎁', 0x0A}, {'뎃', 0x0B}, {'뎄', 0x0C}, {'뎅', 0x0D}, {'뎌', 0x0E}, {'뎐', 0x0F},
{'뎔', 0x10}, {'뎠', 0x11}, {'뎡', 0x12}, {'뎨', 0x13}, {'뎬', 0x14}, {'도', 0x15}, {'독', 0x16}, {'돈', 0x17}, {'돋', 0x18}, {'돌', 0x19}, {'돎', 0x1A}, {'돔', 0x1C}, {'돕', 0x1D}, {'돗', 0x1E}, {'동', 0x1F},
{'돛', 0x20}, {'돝', 0x21}, {'돠', 0x22}, {'돤', 0x23}, {'돨', 0x24}, {'돼', 0x25}, {'됐', 0x26}, {'되', 0x27}, {'된', 0x28}, {'될', 0x29}, {'됨', 0x2A}, {'됩', 0x2B}, {'됫', 0x2C}, {'됴', 0x2D}, {'두', 0x2E}, {'둑', 0x2F},
{'둔', 0x30}, {'둘', 0x31}, {'둠', 0x32}, {'둡', 0x33}, {'둣', 0x34}, {'둥', 0x35}, {'둬', 0x36}, {'뒀', 0x37}, {'뒈', 0x38}, {'뒝', 0x39}, {'뒤', 0x3A}, {'뒨', 0x3B}, {'뒬', 0x3C}, {'뒵', 0x3D}, {'뒷', 0x3E}, {'뒹', 0x3F},
{'듀', 0x40}, {'듄', 0x41}, {'듈', 0x42}, {'듐', 0x43}, {'듕', 0x44}, {'드', 0x45}, {'득', 0x46}, {'든', 0x47}, {'듣', 0x48}, {'들', 0x49}, {'듦', 0x4A}, {'듬', 0x4B}, {'듭', 0x4C}, {'듯', 0x4D}, {'등', 0x4E}, {'듸', 0x4F},
{'디', 0x60}, {'딕', 0x61}, {'딘', 0x62}, {'딛', 0x63}, {'딜', 0x64}, {'딤', 0x65}, {'딥', 0x66}, {'딧', 0x67}, {'딨', 0x68}, {'딩', 0x69}, {'딪', 0x6A}, {'따', 0x6B}, {'딱', 0x6C}, {'딴', 0x6D}, {'딸', 0x6E},
{'땀', 0x71}, {'땁', 0x72}, {'땃', 0x73}, {'땄', 0x74}, {'땅', 0x75}, {'땋', 0x76}, {'때', 0x77}, {'땍', 0x78}, {'땐', 0x79}, {'땔', 0x7A}, {'땜', 0x7B}, {'땝', 0x7C}, {'땟', 0x7D}, {'땠', 0x7E}, {'땡', 0x7F},
{'떠', 0x80}, {'떡', 0x81}, {'떤', 0x82}, {'떨', 0x83}, {'떪', 0x84}, {'떫', 0x85}, {'떰', 0x86}, {'떱', 0x87}, {'떳', 0x88}, {'떴', 0x89}, {'떵', 0x8A}, {'떻', 0x8B}, {'떼', 0x8C}, {'떽', 0x8D}, {'뗀', 0x8E}, {'뗄', 0x8F},
{'뗌', 0x90}, {'뗍', 0x91}, {'뗏', 0x92}, {'뗐', 0x93}, {'뗑', 0x94}, {'뗘', 0x95}, {'뗬', 0x96}, {'또', 0x97}, {'똑', 0x98}, {'똔', 0x99}, {'똘', 0x9A}, {'똥', 0x9B}, {'똬', 0x9C}, {'똴', 0x9D}, {'뙈', 0x9E}, {'뙤', 0x9F},
{'뙨', 0xA0}, {'뚜', 0xA1}, {'뚝', 0xA2}, {'뚠', 0xA3}, {'뚤', 0xA4}, {'뚫', 0xA5}, {'뚬', 0xA6}, {'뚱', 0xA7}, {'뛔', 0xA8}, {'뛰', 0xA9}, {'뛴', 0xAA}, {'뛸', 0xAB}, {'뜀', 0xAC}, {'뜁', 0xAD}, {'뜅', 0xAE}, {'뜨', 0xAF},
{'뜩', 0xB0}, {'뜬', 0xB1}, {'뜯', 0xB2}, {'뜰', 0xB3}, {'뜸', 0xB4}, {'뜹', 0xB5}, {'뜻', 0xB6}, {'띄', 0xB7}, {'띈', 0xB8}, {'띌', 0xB9}, {'띔', 0xBA}, {'띕', 0xBB}, {'띠', 0xBC}, {'띤', 0xBD}, {'띨', 0xBE}, {'띰', 0xBF},
{'띱', 0xC0}, {'띳', 0xC1}, {'띵', 0xC2}, {'라', 0xC3}, {'락', 0xC4}, {'란', 0xC5}, {'랄', 0xC6}, {'람', 0xC7}, {'랍', 0xC8}, {'랏', 0xC9}, {'랐', 0xCA}, {'랑', 0xCB}, {'랒', 0xCC}, {'랖', 0xCD}, {'랗', 0xCE},
{'뢔', 0xD0}, {'래', 0xD1}, {'랙', 0xD2}, {'랜', 0xD3}, {'랠', 0xD4}, {'램', 0xD5}, {'랩', 0xD6}, {'랫', 0xD7}, {'랬', 0xD8}, {'랭', 0xD9}, {'랴', 0xDA}, {'략', 0xDB}, {'랸', 0xDC}, {'럇', 0xDD}, {'량', 0xDE}, {'러', 0xDF},
{'럭', 0xE0}, {'런', 0xE1}, {'럴', 0xE2}, {'럼', 0xE3}, {'럽', 0xE4}, {'럿', 0xE5}, {'렀', 0xE6}, {'렁', 0xE7}, {'렇', 0xE8}, {'레', 0xE9}, {'렉', 0xEA}, {'렌', 0xEB}, {'렐', 0xEC}, {'렘', 0xED}, {'렙', 0xEE}, {'렛', 0xEF},
{'렝', 0xF0}, {'려', 0xF1}, {'력', 0xF2}, {'련', 0xF3}, {'렬', 0xF4}, {'렴', 0xF5}, {'렵', 0xF6}, {'렷', 0xF7}, {'렸', 0xF8}, {'령', 0xF9}, {'례', 0xFA}, {'롄', 0xFB}, {'롑', 0xFC}, {'롓', 0xFD}, {'로', 0xFE}, {'록', 0xFF},
NULL, '덧', '덩', '덫', '덮', '데', '덱', '덴', '델', '뎀', '뎁', '뎃', '뎄', '뎅', '뎌', '뎐',
'뎔', '뎠', '뎡', '뎨', '뎬', '도', '독', '돈', '돋', '돌', '돎', NULL, '돔', '돕', '돗', '동',
'돛', '돝', '돠', '돤', '돨', '돼', '됐', '되', '된', '될', '됨', '됩', '됫', '됴', '두', '둑',
'둔', '둘', '둠', '둡', '둣', '둥', '둬', '뒀', '뒈', '뒝', '뒤', '뒨', '뒬', '뒵', '뒷', '뒹',
'듀', '듄', '듈', '듐', '듕', '드', '득', '든', '듣', '들', '듦', '듬', '듭', '듯', '등', '듸',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'디', '딕', '딘', '딛', '딜', '딤', '딥', '딧', '딨', '딩', '딪', '따', '딱', '딴', '딸', NULL,
NULL, '땀', '땁', '땃', '땄', '땅', '땋', '때', '땍', '땐', '땔', '땜', '땝', '땟', '땠', '땡',
'떠', '떡', '떤', '떨', '떪', '떫', '떰', '떱', '떳', '떴', '떵', '떻', '떼', '떽', '뗀', '뗄',
'뗌', '뗍', '뗏', '뗐', '뗑', '뗘', '뗬', '또', '똑', '똔', '똘', '똥', '똬', '똴', '뙈', '뙤',
'뙨', '뚜', '뚝', '뚠', '뚤', '뚫', '뚬', '뚱', '뛔', '뛰', '뛴', '뛸', '뜀', '뜁', '뜅', '뜨',
'뜩', '뜬', '뜯', '뜰', '뜸', '뜹', '뜻', '띄', '띈', '띌', '띔', '띕', '띠', '띤', '띨', '띰',
'띱', '띳', '띵', '라', '락', '란', '랄', '람', '랍', '랏', '랐', '랑', '랒', '랖', '랗', NULL,
'뢔', '래', '랙', '랜', '랠', '램', '랩', '랫', '랬', '랭', '랴', '략', '랸', '럇', '량', '러',
'럭', '런', '럴', '럼', '럽', '럿', '렀', '렁', '렇', '레', '렉', '렌', '렐', '렘', '렙', '렛',
'렝', '려', '력', '련', '렬', '렴', '렵', '렷', '렸', '령', '례', '롄', '롑', '롓', '로', '록',
};
private static readonly Dictionary<char, byte> U2GSC_KOR_4 = new(256)
private static ReadOnlySpan<char> Table4 => new[]
{
{'론', 0x00}, {'롤', 0x01}, {'롬', 0x02}, {'롭', 0x03}, {'롯', 0x04}, {'롱', 0x05}, {'롸', 0x06}, {'롼', 0x07}, {'뢍', 0x08}, {'뢨', 0x09}, {'뢰', 0x0A}, {'뢴', 0x0B}, {'뢸', 0x0C}, {'룀', 0x0D}, {'룁', 0x0E}, {'룃', 0x0F},
{'룅', 0x10}, {'료', 0x11}, {'룐', 0x12}, {'룔', 0x13}, {'룝', 0x14}, {'룟', 0x15}, {'룡', 0x16}, {'루', 0x17}, {'룩', 0x18}, {'룬', 0x19}, {'룰', 0x1A}, {'룸', 0x1B}, {'룹', 0x1C}, {'룻', 0x1D}, {'룽', 0x1E}, {'뤄', 0x1F},
{'뤘', 0x20}, {'뤠', 0x21}, {'뤼', 0x22}, {'뤽', 0x23}, {'륀', 0x24}, {'륄', 0x25}, {'륌', 0x26}, {'륏', 0x27}, {'륑', 0x28}, {'류', 0x29}, {'륙', 0x2A}, {'륜', 0x2B}, {'률', 0x2C}, {'륨', 0x2D}, {'륩', 0x2E},
{'륫', 0x31}, {'륭', 0x32}, {'르', 0x33}, {'륵', 0x34}, {'른', 0x35}, {'를', 0x36}, {'름', 0x37}, {'릅', 0x38}, {'릇', 0x39}, {'릉', 0x3A}, {'릊', 0x3B}, {'릍', 0x3C}, {'릎', 0x3D}, {'리', 0x3E}, {'릭', 0x3F},
{'린', 0x40}, {'릴', 0x41}, {'림', 0x42}, {'립', 0x43}, {'릿', 0x44}, {'링', 0x45}, {'마', 0x46}, {'막', 0x47}, {'만', 0x48}, {'많', 0x49}, {'맏', 0x4A}, {'말', 0x4B}, {'맑', 0x4C}, {'맒', 0x4D}, {'맘', 0x4E}, {'맙', 0x4F},
{'맛', 0x60}, {'망', 0x61}, {'맞', 0x62}, {'맡', 0x63}, {'맣', 0x64}, {'매', 0x65}, {'맥', 0x66}, {'맨', 0x67}, {'맬', 0x68}, {'맴', 0x69}, {'맵', 0x6A}, {'맷', 0x6B}, {'맸', 0x6C}, {'맹', 0x6D}, {'맺', 0x6E}, {'먀', 0x6F},
{'먁', 0x70}, {'먈', 0x71}, {'먕', 0x72}, {'머', 0x73}, {'먹', 0x74}, {'먼', 0x75}, {'멀', 0x76}, {'멂', 0x77}, {'멈', 0x78}, {'멉', 0x79}, {'멋', 0x7A}, {'멍', 0x7B}, {'멎', 0x7C}, {'멓', 0x7D}, {'메', 0x7E}, {'멕', 0x7F},
{'멘', 0x80}, {'멜', 0x81}, {'멤', 0x82}, {'멥', 0x83}, {'멧', 0x84}, {'멨', 0x85}, {'멩', 0x86}, {'며', 0x87}, {'멱', 0x88}, {'면', 0x89}, {'멸', 0x8A}, {'몃', 0x8B}, {'몄', 0x8C}, {'명', 0x8D}, {'몇', 0x8E}, {'몌', 0x8F},
{'모', 0x90}, {'목', 0x91}, {'몫', 0x92}, {'몬', 0x93}, {'몰', 0x94}, {'몲', 0x95}, {'몸', 0x96}, {'몹', 0x97}, {'못', 0x98}, {'몽', 0x99}, {'뫄', 0x9A}, {'뫈', 0x9B}, {'뫘', 0x9C}, {'뫙', 0x9D}, {'뫼', 0x9E},
{'묀', 0xA1}, {'묄', 0xA2}, {'묍', 0xA3}, {'묏', 0xA4}, {'묑', 0xA5}, {'묘', 0xA6}, {'묜', 0xA7}, {'묠', 0xA8}, {'묩', 0xA9}, {'묫', 0xAA}, {'무', 0xAB}, {'묵', 0xAC}, {'묶', 0xAD}, {'문', 0xAE}, {'묻', 0xAF},
{'물', 0xB0}, {'묽', 0xB1}, {'묾', 0xB2}, {'뭄', 0xB3}, {'뭅', 0xB4}, {'뭇', 0xB5}, {'뭉', 0xB6}, {'뭍', 0xB7}, {'뭏', 0xB8}, {'뭐', 0xB9}, {'뭔', 0xBA}, {'뭘', 0xBB}, {'뭡', 0xBC}, {'뭣', 0xBD}, {'뭬', 0xBE}, {'뮈', 0xBF},
{'뮌', 0xC0}, {'뮐', 0xC1}, {'뮤', 0xC2}, {'뮨', 0xC3}, {'뮬', 0xC4}, {'뮴', 0xC5}, {'뮷', 0xC6}, {'므', 0xC7}, {'믄', 0xC8}, {'믈', 0xC9}, {'믐', 0xCA}, {'믓', 0xCB}, {'미', 0xCC}, {'믹', 0xCD}, {'민', 0xCE}, {'믿', 0xCF},
{'밀', 0xD0}, {'밂', 0xD1}, {'밈', 0xD2}, {'밉', 0xD3}, {'밋', 0xD4}, {'밌', 0xD5}, {'밍', 0xD6}, {'및', 0xD7}, {'밑', 0xD8}, {'바', 0xD9}, {'박', 0xDA}, {'밖', 0xDB}, {'밗', 0xDC}, {'반', 0xDD}, {'받', 0xDE}, {'발', 0xDF},
{'밝', 0xE0}, {'밞', 0xE1}, {'밟', 0xE2}, {'밤', 0xE3}, {'밥', 0xE4}, {'밧', 0xE5}, {'방', 0xE6}, {'밭', 0xE7}, {'배', 0xE8}, {'백', 0xE9}, {'밴', 0xEA}, {'밸', 0xEB}, {'뱀', 0xEC}, {'뱁', 0xED}, {'뱃', 0xEE}, {'뱄', 0xEF},
{'뱅', 0xF0}, {'뱉', 0xF1}, {'뱌', 0xF2}, {'뱍', 0xF3}, {'뱐', 0xF4}, {'뱝', 0xF5}, {'버', 0xF6}, {'벅', 0xF7}, {'번', 0xF8}, {'벋', 0xF9}, {'벌', 0xFA}, {'벎', 0xFB}, {'범', 0xFC}, {'법', 0xFD}, {'벗', 0xFE},
'론', '롤', '롬', '롭', '롯', '롱', '롸', '롼', '뢍', '뢨', '뢰', '뢴', '뢸', '룀', '룁', '룃',
'룅', '료', '룐', '룔', '룝', '룟', '룡', '루', '룩', '룬', '룰', '룸', '룹', '룻', '룽', '뤄',
'뤘', '뤠', '뤼', '뤽', '륀', '륄', '륌', '륏', '륑', '류', '륙', '륜', '률', '륨', '륩', NULL,
NULL, '륫', '륭', '르', '륵', '른', '를', '름', '릅', '릇', '릉', '릊', '릍', '릎', '리', '릭',
'린', '릴', '림', '립', '릿', '링', '마', '막', '만', '많', '맏', '말', '맑', '맒', '맘', '맙',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'맛', '망', '맞', '맡', '맣', '매', '맥', '맨', '맬', '맴', '맵', '맷', '맸', '맹', '맺', '먀',
'먁', '먈', '먕', '머', '먹', '먼', '멀', '멂', '멈', '멉', '멋', '멍', '멎', '멓', '메', '멕',
'멘', '멜', '멤', '멥', '멧', '멨', '멩', '며', '멱', '면', '멸', '몃', '몄', '명', '몇', '몌',
'모', '목', '몫', '몬', '몰', '몲', '몸', '몹', '못', '몽', '뫄', '뫈', '뫘', '뫙', '뫼', NULL,
NULL, '묀', '묄', '묍', '묏', '묑', '묘', '묜', '묠', '묩', '묫', '무', '묵', '묶', '문', '묻',
'물', '묽', '묾', '뭄', '뭅', '뭇', '뭉', '뭍', '뭏', '뭐', '뭔', '뭘', '뭡', '뭣', '뭬', '뮈',
'뮌', '뮐', '뮤', '뮨', '뮬', '뮴', '뮷', '므', '믄', '믈', '믐', '믓', '미', '믹', '민', '믿',
'밀', '밂', '밈', '밉', '밋', '밌', '밍', '및', '밑', '바', '박', '밖', '밗', '반', '받', '발',
'밝', '밞', '밟', '밤', '밥', '밧', '방', '밭', '배', '백', '밴', '밸', '뱀', '뱁', '뱃', '뱄',
'뱅', '뱉', '뱌', '뱍', '뱐', '뱝', '버', '벅', '번', '벋', '벌', '벎', '범', '법', '벗', NULL,
};
private static readonly Dictionary<char, byte> U2GSC_KOR_5 = new(256)
private static ReadOnlySpan<char> Table5 => new[]
{
{'벙', 0x01}, {'벚', 0x02}, {'베', 0x03}, {'벡', 0x04}, {'벤', 0x05}, {'벧', 0x06}, {'벨', 0x07}, {'벰', 0x08}, {'벱', 0x09}, {'벳', 0x0A}, {'벴', 0x0B}, {'벵', 0x0C}, {'벼', 0x0D}, {'벽', 0x0E}, {'변', 0x0F},
{'별', 0x10}, {'볍', 0x11}, {'볏', 0x12}, {'볐', 0x13}, {'병', 0x14}, {'볕', 0x15}, {'볘', 0x16}, {'볜', 0x17}, {'보', 0x18}, {'복', 0x19}, {'볶', 0x1A}, {'본', 0x1B}, {'볼', 0x1C}, {'봄', 0x1D}, {'봅', 0x1E}, {'봇', 0x1F},
{'봉', 0x20}, {'봐', 0x21}, {'봔', 0x22}, {'봤', 0x23}, {'봬', 0x24}, {'뵀', 0x25}, {'뵈', 0x26}, {'뵉', 0x27}, {'뵌', 0x28}, {'뵐', 0x29}, {'뵘', 0x2A}, {'뵙', 0x2B}, {'뵤', 0x2C}, {'뵨', 0x2D}, {'부', 0x2E}, {'북', 0x2F},
{'분', 0x30}, {'붇', 0x31}, {'불', 0x32}, {'붉', 0x33}, {'붊', 0x34}, {'붐', 0x35}, {'붑', 0x36}, {'붓', 0x37}, {'붕', 0x38}, {'붙', 0x39}, {'붚', 0x3A}, {'붜', 0x3B}, {'붤', 0x3C}, {'붰', 0x3D}, {'붸', 0x3E}, {'뷔', 0x3F},
{'뷕', 0x40}, {'뷘', 0x41}, {'뷜', 0x42}, {'뷩', 0x43}, {'뷰', 0x44}, {'뷴', 0x45}, {'뷸', 0x46}, {'븀', 0x47}, {'븃', 0x48}, {'븅', 0x49}, {'브', 0x4A}, {'븍', 0x4B}, {'븐', 0x4C}, {'블', 0x4D}, {'븜', 0x4E}, {'븝', 0x4F},
{'븟', 0x60}, {'비', 0x61}, {'빅', 0x62}, {'빈', 0x63}, {'빌', 0x64}, {'빎', 0x65}, {'빔', 0x66}, {'빕', 0x67}, {'빗', 0x68}, {'빙', 0x69}, {'빚', 0x6A}, {'빛', 0x6B}, {'빠', 0x6C}, {'빡', 0x6D}, {'빤', 0x6E},
{'빨', 0x71}, {'빪', 0x72}, {'빰', 0x73}, {'빱', 0x74}, {'빳', 0x75}, {'빴', 0x76}, {'빵', 0x77}, {'빻', 0x78}, {'빼', 0x79}, {'빽', 0x7A}, {'뺀', 0x7B}, {'뺄', 0x7C}, {'뺌', 0x7D}, {'뺍', 0x7E}, {'뺏', 0x7F},
{'뺐', 0x80}, {'뺑', 0x81}, {'뺘', 0x82}, {'뺙', 0x83}, {'뺨', 0x84}, {'뻐', 0x85}, {'뻑', 0x86}, {'뻔', 0x87}, {'뻗', 0x88}, {'뻘', 0x89}, {'뻠', 0x8A}, {'뻣', 0x8B}, {'뻤', 0x8C}, {'뻥', 0x8D}, {'뻬', 0x8E}, {'뼁', 0x8F},
{'뼈', 0x90}, {'뼉', 0x91}, {'뼘', 0x92}, {'뼙', 0x93}, {'뼛', 0x94}, {'뼜', 0x95}, {'뼝', 0x96}, {'뽀', 0x97}, {'뽁', 0x98}, {'뽄', 0x99}, {'뽈', 0x9A}, {'뽐', 0x9B}, {'뽑', 0x9C}, {'뽕', 0x9D}, {'뾔', 0x9E}, {'뾰', 0x9F},
{'뿅', 0xA0}, {'뿌', 0xA1}, {'뿍', 0xA2}, {'뿐', 0xA3}, {'뿔', 0xA4}, {'뿜', 0xA5}, {'뿟', 0xA6}, {'뿡', 0xA7}, {'쀼', 0xA8}, {'쁑', 0xA9}, {'쁘', 0xAA}, {'쁜', 0xAB}, {'쁠', 0xAC}, {'쁨', 0xAD}, {'쁩', 0xAE}, {'삐', 0xAF},
{'삑', 0xB0}, {'삔', 0xB1}, {'삘', 0xB2}, {'삠', 0xB3}, {'삡', 0xB4}, {'삣', 0xB5}, {'삥', 0xB6}, {'사', 0xB7}, {'삭', 0xB8}, {'삯', 0xB9}, {'산', 0xBA}, {'삳', 0xBB}, {'살', 0xBC}, {'삵', 0xBD}, {'삶', 0xBE}, {'삼', 0xBF},
{'삽', 0xC0}, {'삿', 0xC1}, {'샀', 0xC2}, {'상', 0xC3}, {'샅', 0xC4}, {'새', 0xC5}, {'색', 0xC6}, {'샌', 0xC7}, {'샐', 0xC8}, {'샘', 0xC9}, {'샙', 0xCA}, {'샛', 0xCB}, {'샜', 0xCC}, {'생', 0xCD}, {'샤', 0xCE},
{'샥', 0xD1}, {'샨', 0xD2}, {'샬', 0xD3}, {'샴', 0xD4}, {'샵', 0xD5}, {'샷', 0xD6}, {'샹', 0xD7}, {'섀', 0xD8}, {'섄', 0xD9}, {'섈', 0xDA}, {'섐', 0xDB}, {'섕', 0xDC}, {'서', 0xDD}, {'석', 0xDE}, {'섞', 0xDF},
{'섟', 0xE0}, {'선', 0xE1}, {'섣', 0xE2}, {'설', 0xE3}, {'섦', 0xE4}, {'섧', 0xE5}, {'섬', 0xE6}, {'섭', 0xE7}, {'섯', 0xE8}, {'섰', 0xE9}, {'성', 0xEA}, {'섶', 0xEB}, {'세', 0xEC}, {'섹', 0xED}, {'센', 0xEE}, {'셀', 0xEF},
{'셈', 0xF0}, {'셉', 0xF1}, {'셋', 0xF2}, {'셌', 0xF3}, {'셍', 0xF4}, {'셔', 0xF5}, {'셕', 0xF6}, {'션', 0xF7}, {'셜', 0xF8}, {'셤', 0xF9}, {'셥', 0xFA}, {'셧', 0xFB}, {'셨', 0xFC}, {'셩', 0xFD}, {'셰', 0xFE}, {'셴', 0xFF},
NULL, '벙', '벚', '베', '벡', '벤', '벧', '벨', '벰', '벱', '벳', '벴', '벵', '벼', '벽', '변',
'별', '볍', '볏', '볐', '병', '볕', '볘', '볜', '보', '복', '볶', '본', '볼', '봄', '봅', '봇',
'봉', '봐', '봔', '봤', '봬', '뵀', '뵈', '뵉', '뵌', '뵐', '뵘', '뵙', '뵤', '뵨', '부', '북',
'분', '붇', '불', '붉', '붊', '붐', '붑', '붓', '붕', '붙', '붚', '붜', '붤', '붰', '붸', '뷔',
'뷕', '뷘', '뷜', '뷩', '뷰', '뷴', '뷸', '븀', '븃', '븅', '브', '븍', '븐', '블', '븜', '븝',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'븟', '비', '빅', '빈', '빌', '빎', '빔', '빕', '빗', '빙', '빚', '빛', '빠', '빡', '빤', NULL,
NULL, '빨', '빪', '빰', '빱', '빳', '빴', '빵', '빻', '빼', '빽', '뺀', '뺄', '뺌', '뺍', '뺏',
'뺐', '뺑', '뺘', '뺙', '뺨', '뻐', '뻑', '뻔', '뻗', '뻘', '뻠', '뻣', '뻤', '뻥', '뻬', '뼁',
'뼈', '뼉', '뼘', '뼙', '뼛', '뼜', '뼝', '뽀', '뽁', '뽄', '뽈', '뽐', '뽑', '뽕', '뾔', '뾰',
'뿅', '뿌', '뿍', '뿐', '뿔', '뿜', '뿟', '뿡', '쀼', '쁑', '쁘', '쁜', '쁠', '쁨', '쁩', '삐',
'삑', '삔', '삘', '삠', '삡', '삣', '삥', '사', '삭', '삯', '산', '삳', '살', '삵', '삶', '삼',
'삽', '삿', '샀', '상', '샅', '새', '색', '샌', '샐', '샘', '샙', '샛', '샜', '생', '샤', NULL,
NULL, '샥', '샨', '샬', '샴', '샵', '샷', '샹', '섀', '섄', '섈', '섐', '섕', '서', '석', '섞',
'섟', '선', '섣', '설', '섦', '섧', '섬', '섭', '섯', '섰', '성', '섶', '세', '섹', '센', '셀',
'셈', '셉', '셋', '셌', '셍', '셔', '셕', '션', '셜', '셤', '셥', '셧', '셨', '셩', '셰', '셴',
};
private static readonly Dictionary<char, byte> U2GSC_KOR_6 = new(256)
private static ReadOnlySpan<char> Table6 => new[]
{
{'셸', 0x00}, {'솅', 0x01}, {'소', 0x02}, {'속', 0x03}, {'솎', 0x04}, {'손', 0x05}, {'솔', 0x06}, {'솖', 0x07}, {'솜', 0x08}, {'솝', 0x09}, {'솟', 0x0A}, {'송', 0x0B}, {'솥', 0x0C}, {'솨', 0x0D}, {'솩', 0x0E}, {'솬', 0x0F},
{'솰', 0x10}, {'솽', 0x11}, {'쇄', 0x12}, {'쇈', 0x13}, {'쇌', 0x14}, {'쇔', 0x15}, {'쇗', 0x16}, {'쇘', 0x17}, {'쇠', 0x18}, {'쇤', 0x19}, {'쇨', 0x1A}, {'쇰', 0x1B}, {'쇱', 0x1C}, {'쇳', 0x1D}, {'쇼', 0x1E}, {'쇽', 0x1F},
{'숀', 0x20}, {'숄', 0x21}, {'숌', 0x22}, {'숍', 0x23}, {'숏', 0x24}, {'숑', 0x25}, {'수', 0x26}, {'숙', 0x27}, {'순', 0x28}, {'숟', 0x29}, {'술', 0x2A}, {'숨', 0x2B}, {'숩', 0x2C}, {'숫', 0x2D}, {'숭', 0x2E}, {'쌰', 0x2F},
{'쎼', 0x30}, {'숯', 0x31}, {'숱', 0x32}, {'숲', 0x33}, {'숴', 0x34}, {'쉈', 0x35}, {'쉐', 0x36}, {'쉑', 0x37}, {'쉔', 0x38}, {'쉘', 0x39}, {'쉠', 0x3A}, {'쉥', 0x3B}, {'쉬', 0x3C}, {'쉭', 0x3D}, {'쉰', 0x3E}, {'쉴', 0x3F},
{'쉼', 0x40}, {'쉽', 0x41}, {'쉿', 0x42}, {'슁', 0x43}, {'슈', 0x44}, {'슉', 0x45}, {'슐', 0x46}, {'슘', 0x47}, {'슛', 0x48}, {'슝', 0x49}, {'스', 0x4A}, {'슥', 0x4B}, {'슨', 0x4C}, {'슬', 0x4D}, {'슭', 0x4E}, {'슴', 0x4F},
{'습', 0x60}, {'슷', 0x61}, {'승', 0x62}, {'시', 0x63}, {'식', 0x64}, {'신', 0x65}, {'싣', 0x66}, {'실', 0x67}, {'싫', 0x68}, {'심', 0x69}, {'십', 0x6A}, {'싯', 0x6B}, {'싱', 0x6C}, {'싶', 0x6D}, {'싸', 0x6E}, {'싹', 0x6F},
{'싻', 0x70}, {'싼', 0x71}, {'쌀', 0x72}, {'쌈', 0x73}, {'쌉', 0x74}, {'쌌', 0x75}, {'쌍', 0x76}, {'쌓', 0x77}, {'쌔', 0x78}, {'쌕', 0x79}, {'쌘', 0x7A}, {'쌜', 0x7B}, {'쌤', 0x7C}, {'쌥', 0x7D}, {'쌨', 0x7E}, {'쌩', 0x7F},
{'썅', 0x80}, {'써', 0x81}, {'썩', 0x82}, {'썬', 0x83}, {'썰', 0x84}, {'썲', 0x85}, {'썸', 0x86}, {'썹', 0x87}, {'썼', 0x88}, {'썽', 0x89}, {'쎄', 0x8A}, {'쎈', 0x8B}, {'쎌', 0x8C}, {'쏀', 0x8D}, {'쏘', 0x8E}, {'쏙', 0x8F},
{'쏜', 0x90}, {'쏟', 0x91}, {'쏠', 0x92}, {'쏢', 0x93}, {'쏨', 0x94}, {'쏩', 0x95}, {'쏭', 0x96}, {'쏴', 0x97}, {'쏵', 0x98}, {'쏸', 0x99}, {'쐈', 0x9A}, {'쐐', 0x9B}, {'쐤', 0x9C}, {'쐬', 0x9D}, {'쐰', 0x9E},
{'쓔', 0xA0}, {'쐴', 0xA1}, {'쐼', 0xA2}, {'쐽', 0xA3}, {'쑈', 0xA4}, {'쑤', 0xA5}, {'쑥', 0xA6}, {'쑨', 0xA7}, {'쑬', 0xA8}, {'쑴', 0xA9}, {'쑵', 0xAA}, {'쑹', 0xAB}, {'쒀', 0xAC}, {'쒔', 0xAD}, {'쒜', 0xAE}, {'쒸', 0xAF},
{'쒼', 0xB0}, {'쓩', 0xB1}, {'쓰', 0xB2}, {'쓱', 0xB3}, {'쓴', 0xB4}, {'쓸', 0xB5}, {'쓺', 0xB6}, {'쓿', 0xB7}, {'씀', 0xB8}, {'씁', 0xB9}, {'씌', 0xBA}, {'씐', 0xBB}, {'씔', 0xBC}, {'씜', 0xBD}, {'씨', 0xBE}, {'씩', 0xBF},
{'씬', 0xC0}, {'씰', 0xC1}, {'씸', 0xC2}, {'씹', 0xC3}, {'씻', 0xC4}, {'씽', 0xC5}, {'아', 0xC6}, {'악', 0xC7}, {'안', 0xC8}, {'앉', 0xC9}, {'않', 0xCA}, {'알', 0xCB}, {'앍', 0xCC}, {'앎', 0xCD}, {'앓', 0xCE}, {'암', 0xCF},
{'압', 0xD0}, {'앗', 0xD1}, {'았', 0xD2}, {'앙', 0xD3}, {'앝', 0xD4}, {'앞', 0xD5}, {'애', 0xD6}, {'액', 0xD7}, {'앤', 0xD8}, {'앨', 0xD9}, {'앰', 0xDA}, {'앱', 0xDB}, {'앳', 0xDC}, {'앴', 0xDD}, {'앵', 0xDE}, {'야', 0xDF},
{'약', 0xE0}, {'얀', 0xE1}, {'얄', 0xE2}, {'얇', 0xE3}, {'얌', 0xE4}, {'얍', 0xE5}, {'얏', 0xE6}, {'양', 0xE7}, {'얕', 0xE8}, {'얗', 0xE9}, {'얘', 0xEA}, {'얜', 0xEB}, {'얠', 0xEC}, {'얩', 0xED}, {'어', 0xEE}, {'억', 0xEF},
{'언', 0xF0}, {'얹', 0xF1}, {'얻', 0xF2}, {'얼', 0xF3}, {'얽', 0xF4}, {'얾', 0xF5}, {'엄', 0xF6}, {'업', 0xF7}, {'없', 0xF8}, {'엇', 0xF9}, {'었', 0xFA}, {'엉', 0xFB}, {'엊', 0xFC}, {'엌', 0xFD}, {'엎', 0xFE},
'셸', '솅', '소', '속', '솎', '손', '솔', '솖', '솜', '솝', '솟', '송', '솥', '솨', '솩', '솬',
'솰', '솽', '쇄', '쇈', '쇌', '쇔', '쇗', '쇘', '쇠', '쇤', '쇨', '쇰', '쇱', '쇳', '쇼', '쇽',
'숀', '숄', '숌', '숍', '숏', '숑', '수', '숙', '순', '숟', '술', '숨', '숩', '숫', '숭', '쌰',
'쎼', '숯', '숱', '숲', '숴', '쉈', '쉐', '쉑', '쉔', '쉘', '쉠', '쉥', '쉬', '쉭', '쉰', '쉴',
'쉼', '쉽', '쉿', '슁', '슈', '슉', '슐', '슘', '슛', '슝', '스', '슥', '슨', '슬', '슭', '슴',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'습', '슷', '승', '시', '식', '신', '싣', '실', '싫', '심', '십', '싯', '싱', '싶', '싸', '싹',
'싻', '싼', '쌀', '쌈', '쌉', '쌌', '쌍', '쌓', '쌔', '쌕', '쌘', '쌜', '쌤', '쌥', '쌨', '쌩',
'썅', '써', '썩', '썬', '썰', '썲', '썸', '썹', '썼', '썽', '쎄', '쎈', '쎌', '쏀', '쏘', '쏙',
'쏜', '쏟', '쏠', '쏢', '쏨', '쏩', '쏭', '쏴', '쏵', '쏸', '쐈', '쐐', '쐤', '쐬', '쐰', NULL,
'쓔', '쐴', '쐼', '쐽', '쑈', '쑤', '쑥', '쑨', '쑬', '쑴', '쑵', '쑹', '쒀', '쒔', '쒜', '쒸',
'쒼', '쓩', '쓰', '쓱', '쓴', '쓸', '쓺', '쓿', '씀', '씁', '씌', '씐', '씔', '씜', '씨', '씩',
'씬', '씰', '씸', '씹', '씻', '씽', '아', '악', '안', '앉', '않', '알', '앍', '앎', '앓', '암',
'압', '앗', '았', '앙', '앝', '앞', '애', '액', '앤', '앨', '앰', '앱', '앳', '앴', '앵', '야',
'약', '얀', '얄', '얇', '얌', '얍', '얏', '양', '얕', '얗', '얘', '얜', '얠', '얩', '어', '억',
'언', '얹', '얻', '얼', '얽', '얾', '엄', '업', '없', '엇', '었', '엉', '엊', '엌', '엎', NULL,
};
private static readonly Dictionary<char, byte> U2GSC_KOR_7 = new(256)
private static ReadOnlySpan<char> Table7 => new[]
{
{'에', 0x01}, {'엑', 0x02}, {'엔', 0x03}, {'엘', 0x04}, {'엠', 0x05}, {'엡', 0x06}, {'엣', 0x07}, {'엥', 0x08}, {'여', 0x09}, {'역', 0x0A}, {'엮', 0x0B}, {'연', 0x0C}, {'열', 0x0D}, {'엶', 0x0E}, {'엷', 0x0F},
{'염', 0x10}, {'엽', 0x11}, {'엾', 0x12}, {'엿', 0x13}, {'였', 0x14}, {'영', 0x15}, {'옅', 0x16}, {'옆', 0x17}, {'옇', 0x18}, {'예', 0x19}, {'옌', 0x1A}, {'옐', 0x1B}, {'옘', 0x1C}, {'옙', 0x1D}, {'옛', 0x1E}, {'옜', 0x1F},
{'오', 0x20}, {'옥', 0x21}, {'온', 0x22}, {'올', 0x23}, {'옭', 0x24}, {'옮', 0x25}, {'옰', 0x26}, {'옳', 0x27}, {'옴', 0x28}, {'옵', 0x29}, {'옷', 0x2A}, {'옹', 0x2B}, {'옻', 0x2C}, {'와', 0x2D}, {'왁', 0x2E}, {'완', 0x2F},
{'왈', 0x30}, {'왐', 0x31}, {'왑', 0x32}, {'왓', 0x33}, {'왔', 0x34}, {'왕', 0x35}, {'왜', 0x36}, {'왝', 0x37}, {'왠', 0x38}, {'왬', 0x39}, {'왯', 0x3A}, {'왱', 0x3B}, {'외', 0x3C}, {'왹', 0x3D}, {'왼', 0x3E}, {'욀', 0x3F},
{'욈', 0x40}, {'욉', 0x41}, {'욋', 0x42}, {'욍', 0x43}, {'요', 0x44}, {'욕', 0x45}, {'욘', 0x46}, {'욜', 0x47}, {'욤', 0x48}, {'욥', 0x49}, {'욧', 0x4A}, {'용', 0x4B}, {'우', 0x4C}, {'욱', 0x4D}, {'운', 0x4E}, {'울', 0x4F},
{'욹', 0x60}, {'욺', 0x61}, {'움', 0x62}, {'웁', 0x63}, {'웃', 0x64}, {'웅', 0x65}, {'워', 0x66}, {'웍', 0x67}, {'원', 0x68}, {'월', 0x69}, {'웜', 0x6A}, {'웝', 0x6B}, {'웠', 0x6C}, {'웡', 0x6D}, {'웨', 0x6E},
{'웩', 0x71}, {'웬', 0x72}, {'웰', 0x73}, {'웸', 0x74}, {'웹', 0x75}, {'웽', 0x76}, {'위', 0x77}, {'윅', 0x78}, {'윈', 0x79}, {'윌', 0x7A}, {'윔', 0x7B}, {'윕', 0x7C}, {'윗', 0x7D}, {'윙', 0x7E}, {'유', 0x7F},
{'육', 0x80}, {'윤', 0x81}, {'율', 0x82}, {'윰', 0x83}, {'윱', 0x84}, {'윳', 0x85}, {'융', 0x86}, {'윷', 0x87}, {'으', 0x88}, {'윽', 0x89}, {'은', 0x8A}, {'을', 0x8B}, {'읆', 0x8C}, {'음', 0x8D}, {'읍', 0x8E}, {'읏', 0x8F},
{'응', 0x90}, {'읒', 0x91}, {'읓', 0x92}, {'읔', 0x93}, {'읕', 0x94}, {'읖', 0x95}, {'읗', 0x96}, {'의', 0x97}, {'읜', 0x98}, {'읠', 0x99}, {'읨', 0x9A}, {'읫', 0x9B}, {'이', 0x9C}, {'익', 0x9D}, {'인', 0x9E}, {'일', 0x9F},
{'읽', 0xA0}, {'읾', 0xA1}, {'잃', 0xA2}, {'임', 0xA3}, {'입', 0xA4}, {'잇', 0xA5}, {'있', 0xA6}, {'잉', 0xA7}, {'잊', 0xA8}, {'잎', 0xA9}, {'자', 0xAA}, {'작', 0xAB}, {'잔', 0xAC}, {'잖', 0xAD}, {'잗', 0xAE}, {'잘', 0xAF},
{'잚', 0xB0}, {'잠', 0xB1}, {'잡', 0xB2}, {'잣', 0xB3}, {'잤', 0xB4}, {'장', 0xB5}, {'잦', 0xB6}, {'재', 0xB7}, {'잭', 0xB8}, {'잰', 0xB9}, {'잴', 0xBA}, {'잼', 0xBB}, {'잽', 0xBC}, {'잿', 0xBD}, {'쟀', 0xBE}, {'쟁', 0xBF},
{'쟈', 0xC0}, {'쟉', 0xC1}, {'쟌', 0xC2}, {'쟎', 0xC3}, {'쟐', 0xC4}, {'쟘', 0xC5}, {'쟝', 0xC6}, {'쟤', 0xC7}, {'쟨', 0xC8}, {'쟬', 0xC9}, {'저', 0xCA}, {'적', 0xCB}, {'전', 0xCC}, {'절', 0xCD}, {'젊', 0xCE},
{'점', 0xD1}, {'접', 0xD2}, {'젓', 0xD3}, {'정', 0xD4}, {'젖', 0xD5}, {'제', 0xD6}, {'젝', 0xD7}, {'젠', 0xD8}, {'젤', 0xD9}, {'젬', 0xDA}, {'젭', 0xDB}, {'젯', 0xDC}, {'젱', 0xDD}, {'져', 0xDE}, {'젼', 0xDF},
{'졀', 0xE0}, {'졈', 0xE1}, {'졉', 0xE2}, {'졌', 0xE3}, {'졍', 0xE4}, {'졔', 0xE5}, {'조', 0xE6}, {'족', 0xE7}, {'존', 0xE8}, {'졸', 0xE9}, {'졺', 0xEA}, {'좀', 0xEB}, {'좁', 0xEC}, {'좃', 0xED}, {'종', 0xEE}, {'좆', 0xEF},
{'좇', 0xF0}, {'좋', 0xF1}, {'좌', 0xF2}, {'좍', 0xF3}, {'좔', 0xF4}, {'좝', 0xF5}, {'좟', 0xF6}, {'좡', 0xF7}, {'좨', 0xF8}, {'좼', 0xF9}, {'좽', 0xFA}, {'죄', 0xFB}, {'죈', 0xFC}, {'죌', 0xFD}, {'죔', 0xFE}, {'죕', 0xFF},
NULL, '에', '엑', '엔', '엘', '엠', '엡', '엣', '엥', '여', '역', '엮', '연', '열', '엶', '엷',
'염', '엽', '엾', '엿', '였', '영', '옅', '옆', '옇', '예', '옌', '옐', '옘', '옙', '옛', '옜',
'오', '옥', '온', '올', '옭', '옮', '옰', '옳', '옴', '옵', '옷', '옹', '옻', '와', '왁', '완',
'왈', '왐', '왑', '왓', '왔', '왕', '왜', '왝', '왠', '왬', '왯', '왱', '외', '왹', '왼', '욀',
'욈', '욉', '욋', '욍', '요', '욕', '욘', '욜', '욤', '욥', '욧', '용', '우', '욱', '운', '울',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'욹', '욺', '움', '웁', '웃', '웅', '워', '웍', '원', '월', '웜', '웝', '웠', '웡', '웨', NULL,
NULL, '웩', '웬', '웰', '웸', '웹', '웽', '위', '윅', '윈', '윌', '윔', '윕', '윗', '윙', '유',
'육', '윤', '율', '윰', '윱', '윳', '융', '윷', '으', '윽', '은', '을', '읆', '음', '읍', '읏',
'응', '읒', '읓', '읔', '읕', '읖', '읗', '의', '읜', '읠', '읨', '읫', '이', '익', '인', '일',
'읽', '읾', '잃', '임', '입', '잇', '있', '잉', '잊', '잎', '자', '작', '잔', '잖', '잗', '잘',
'잚', '잠', '잡', '잣', '잤', '장', '잦', '재', '잭', '잰', '잴', '잼', '잽', '잿', '쟀', '쟁',
'쟈', '쟉', '쟌', '쟎', '쟐', '쟘', '쟝', '쟤', '쟨', '쟬', '저', '적', '전', '절', '젊', NULL,
NULL, '점', '접', '젓', '정', '젖', '제', '젝', '젠', '젤', '젬', '젭', '젯', '젱', '져', '젼',
'졀', '졈', '졉', '졌', '졍', '졔', '조', '족', '존', '졸', '졺', '좀', '좁', '좃', '종', '좆',
'좇', '좋', '좌', '좍', '좔', '좝', '좟', '좡', '좨', '좼', '좽', '죄', '죈', '죌', '죔', '죕',
};
private static readonly Dictionary<char, byte> U2GSC_KOR_8 = new(256)
private static ReadOnlySpan<char> Table8 => new[]
{
{'죗', 0x00}, {'죙', 0x01}, {'죠', 0x02}, {'죡', 0x03}, {'죤', 0x04}, {'죵', 0x05}, {'주', 0x06}, {'죽', 0x07}, {'준', 0x08}, {'줄', 0x09}, {'줅', 0x0A}, {'줆', 0x0B}, {'줌', 0x0C}, {'줍', 0x0D}, {'줏', 0x0E}, {'중', 0x0F},
{'줘', 0x10}, {'줬', 0x11}, {'줴', 0x12}, {'쥐', 0x13}, {'쥑', 0x14}, {'쥔', 0x15}, {'쥘', 0x16}, {'쥠', 0x17}, {'쥡', 0x18}, {'쥣', 0x19}, {'쥬', 0x1A}, {'쥰', 0x1B}, {'쥴', 0x1C}, {'쥼', 0x1D}, {'즈', 0x1E}, {'즉', 0x1F},
{'즌', 0x20}, {'즐', 0x21}, {'즘', 0x22}, {'즙', 0x23}, {'즛', 0x24}, {'증', 0x25}, {'지', 0x26}, {'직', 0x27}, {'진', 0x28}, {'짇', 0x29}, {'질', 0x2A}, {'짊', 0x2B}, {'짐', 0x2C}, {'집', 0x2D}, {'짓', 0x2E},
{'쬬', 0x30}, {'징', 0x31}, {'짖', 0x32}, {'짙', 0x33}, {'짚', 0x34}, {'짜', 0x35}, {'짝', 0x36}, {'짠', 0x37}, {'짢', 0x38}, {'짤', 0x39}, {'짧', 0x3A}, {'짬', 0x3B}, {'짭', 0x3C}, {'짯', 0x3D}, {'짰', 0x3E}, {'짱', 0x3F},
{'째', 0x40}, {'짹', 0x41}, {'짼', 0x42}, {'쨀', 0x43}, {'쨈', 0x44}, {'쨉', 0x45}, {'쨋', 0x46}, {'쨌', 0x47}, {'쨍', 0x48}, {'쨔', 0x49}, {'쨘', 0x4A}, {'쨩', 0x4B}, {'쩌', 0x4C}, {'쩍', 0x4D}, {'쩐', 0x4E}, {'쩔', 0x4F},
{'쩜', 0x60}, {'쩝', 0x61}, {'쩟', 0x62}, {'쩠', 0x63}, {'쩡', 0x64}, {'쩨', 0x65}, {'쩽', 0x66}, {'쪄', 0x67}, {'쪘', 0x68}, {'쪼', 0x69}, {'쪽', 0x6A}, {'쫀', 0x6B}, {'쫄', 0x6C}, {'쫌', 0x6D}, {'쫍', 0x6E}, {'쫏', 0x6F},
{'쫑', 0x70}, {'쫓', 0x71}, {'쫘', 0x72}, {'쫙', 0x73}, {'쫠', 0x74}, {'쫬', 0x75}, {'쫴', 0x76}, {'쬈', 0x77}, {'쬐', 0x78}, {'쬔', 0x79}, {'쬘', 0x7A}, {'쬠', 0x7B}, {'쬡', 0x7C}, {'쭁', 0x7D}, {'쭈', 0x7E}, {'쭉', 0x7F},
{'쭌', 0x80}, {'쭐', 0x81}, {'쭘', 0x82}, {'쭙', 0x83}, {'쭝', 0x84}, {'쭤', 0x85}, {'쭸', 0x86}, {'쭹', 0x87}, {'쮜', 0x88}, {'쮸', 0x89}, {'쯔', 0x8A}, {'쯤', 0x8B}, {'쯧', 0x8C}, {'쯩', 0x8D}, {'찌', 0x8E}, {'찍', 0x8F},
{'찐', 0x90}, {'찔', 0x91}, {'찜', 0x92}, {'찝', 0x93}, {'찡', 0x94}, {'찢', 0x95}, {'찧', 0x96}, {'차', 0x97}, {'착', 0x98}, {'찬', 0x99}, {'찮', 0x9A}, {'찰', 0x9B}, {'참', 0x9C}, {'찹', 0x9D}, {'찻', 0x9E},
{'찼', 0xA1}, {'창', 0xA2}, {'찾', 0xA3}, {'채', 0xA4}, {'책', 0xA5}, {'챈', 0xA6}, {'챌', 0xA7}, {'챔', 0xA8}, {'챕', 0xA9}, {'챗', 0xAA}, {'챘', 0xAB}, {'챙', 0xAC}, {'챠', 0xAD}, {'챤', 0xAE}, {'챦', 0xAF},
{'챨', 0xB0}, {'챰', 0xB1}, {'챵', 0xB2}, {'처', 0xB3}, {'척', 0xB4}, {'천', 0xB5}, {'철', 0xB6}, {'첨', 0xB7}, {'첩', 0xB8}, {'첫', 0xB9}, {'첬', 0xBA}, {'청', 0xBB}, {'체', 0xBC}, {'첵', 0xBD}, {'첸', 0xBE}, {'첼', 0xBF},
{'쳄', 0xC0}, {'쳅', 0xC1}, {'쳇', 0xC2}, {'쳉', 0xC3}, {'쳐', 0xC4}, {'쳔', 0xC5}, {'쳤', 0xC6}, {'쳬', 0xC7}, {'쳰', 0xC8}, {'촁', 0xC9}, {'초', 0xCA}, {'촉', 0xCB}, {'촌', 0xCC}, {'촐', 0xCD}, {'촘', 0xCE}, {'촙', 0xCF},
{'촛', 0xD0}, {'총', 0xD1}, {'촤', 0xD2}, {'촨', 0xD3}, {'촬', 0xD4}, {'촹', 0xD5}, {'최', 0xD6}, {'쵠', 0xD7}, {'쵤', 0xD8}, {'쵬', 0xD9}, {'쵭', 0xDA}, {'쵯', 0xDB}, {'쵱', 0xDC}, {'쵸', 0xDD}, {'춈', 0xDE}, {'추', 0xDF},
{'축', 0xE0}, {'춘', 0xE1}, {'출', 0xE2}, {'춤', 0xE3}, {'춥', 0xE4}, {'춧', 0xE5}, {'충', 0xE6}, {'춰', 0xE7}, {'췄', 0xE8}, {'췌', 0xE9}, {'췐', 0xEA}, {'취', 0xEB}, {'췬', 0xEC}, {'췰', 0xED}, {'췸', 0xEE}, {'췹', 0xEF},
{'췻', 0xF0}, {'췽', 0xF1}, {'츄', 0xF2}, {'츈', 0xF3}, {'츌', 0xF4}, {'츔', 0xF5}, {'츙', 0xF6}, {'츠', 0xF7}, {'측', 0xF8}, {'츤', 0xF9}, {'츨', 0xFA}, {'츰', 0xFB}, {'츱', 0xFC}, {'츳', 0xFD}, {'층', 0xFE},
'죗', '죙', '죠', '죡', '죤', '죵', '주', '죽', '준', '줄', '줅', '줆', '줌', '줍', '줏', '중',
'줘', '줬', '줴', '쥐', '쥑', '쥔', '쥘', '쥠', '쥡', '쥣', '쥬', '쥰', '쥴', '쥼', '즈', '즉',
'즌', '즐', '즘', '즙', '즛', '증', '지', '직', '진', '짇', '질', '짊', '짐', '집', '짓', NULL,
'쬬', '징', '짖', '짙', '짚', '짜', '짝', '짠', '짢', '짤', '짧', '짬', '짭', '짯', '짰', '짱',
'째', '짹', '짼', '쨀', '쨈', '쨉', '쨋', '쨌', '쨍', '쨔', '쨘', '쨩', '쩌', '쩍', '쩐', '쩔',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'쩜', '쩝', '쩟', '쩠', '쩡', '쩨', '쩽', '쪄', '쪘', '쪼', '쪽', '쫀', '쫄', '쫌', '쫍', '쫏',
'쫑', '쫓', '쫘', '쫙', '쫠', '쫬', '쫴', '쬈', '쬐', '쬔', '쬘', '쬠', '쬡', '쭁', '쭈', '쭉',
'쭌', '쭐', '쭘', '쭙', '쭝', '쭤', '쭸', '쭹', '쮜', '쮸', '쯔', '쯤', '쯧', '쯩', '찌', '찍',
'찐', '찔', '찜', '찝', '찡', '찢', '찧', '차', '착', '찬', '찮', '찰', '참', '찹', '찻', NULL,
NULL, '찼', '창', '찾', '채', '책', '챈', '챌', '챔', '챕', '챗', '챘', '챙', '챠', '챤', '챦',
'챨', '챰', '챵', '처', '척', '천', '철', '첨', '첩', '첫', '첬', '청', '체', '첵', '첸', '첼',
'쳄', '쳅', '쳇', '쳉', '쳐', '쳔', '쳤', '쳬', '쳰', '촁', '초', '촉', '촌', '촐', '촘', '촙',
'촛', '총', '촤', '촨', '촬', '촹', '최', '쵠', '쵤', '쵬', '쵭', '쵯', '쵱', '쵸', '춈', '추',
'축', '춘', '출', '춤', '춥', '춧', '충', '춰', '췄', '췌', '췐', '취', '췬', '췰', '췸', '췹',
'췻', '췽', '츄', '츈', '츌', '츔', '츙', '츠', '측', '츤', '츨', '츰', '츱', '츳', '층', NULL,
};
private static readonly Dictionary<char, byte> U2GSC_KOR_9 = new(256)
private static ReadOnlySpan<char> Table9 => new[]
{
{'치', 0x01}, {'칙', 0x02}, {'친', 0x03}, {'칟', 0x04}, {'칠', 0x05}, {'칡', 0x06}, {'침', 0x07}, {'칩', 0x08}, {'칫', 0x09}, {'칭', 0x0A}, {'카', 0x0B}, {'칵', 0x0C}, {'칸', 0x0D}, {'칼', 0x0E}, {'캄', 0x0F},
{'캅', 0x10}, {'캇', 0x11}, {'캉', 0x12}, {'캐', 0x13}, {'캑', 0x14}, {'캔', 0x15}, {'캘', 0x16}, {'캠', 0x17}, {'캡', 0x18}, {'캣', 0x19}, {'캤', 0x1A}, {'캥', 0x1B}, {'캬', 0x1C}, {'캭', 0x1D}, {'컁', 0x1E}, {'커', 0x1F},
{'컥', 0x20}, {'컨', 0x21}, {'컫', 0x22}, {'컬', 0x23}, {'컴', 0x24}, {'컵', 0x25}, {'컷', 0x26}, {'컸', 0x27}, {'컹', 0x28}, {'케', 0x29}, {'켁', 0x2A}, {'켄', 0x2B}, {'켈', 0x2C}, {'켐', 0x2D}, {'켑', 0x2E}, {'켓', 0x2F},
{'켕', 0x30}, {'켜', 0x31}, {'켠', 0x32}, {'켤', 0x33}, {'켬', 0x34}, {'켭', 0x35}, {'켯', 0x36}, {'켰', 0x37}, {'켱', 0x38}, {'켸', 0x39}, {'코', 0x3A}, {'콕', 0x3B}, {'콘', 0x3C}, {'콜', 0x3D}, {'콤', 0x3E}, {'콥', 0x3F},
{'콧', 0x40}, {'콩', 0x41}, {'콰', 0x42}, {'콱', 0x43}, {'콴', 0x44}, {'콸', 0x45}, {'쾀', 0x46}, {'쾅', 0x47}, {'쾌', 0x48}, {'쾡', 0x49}, {'쾨', 0x4A}, {'쾰', 0x4B}, {'쿄', 0x4C}, {'쿠', 0x4D}, {'쿡', 0x4E}, {'쿤', 0x4F},
{'쿨', 0x60}, {'쿰', 0x61}, {'쿱', 0x62}, {'쿳', 0x63}, {'쿵', 0x64}, {'쿼', 0x65}, {'퀀', 0x66}, {'퀄', 0x67}, {'퀑', 0x68}, {'퀘', 0x69}, {'퀭', 0x6A}, {'퀴', 0x6B}, {'퀵', 0x6C}, {'퀸', 0x6D}, {'퀼', 0x6E},
{'큄', 0x71}, {'큅', 0x72}, {'큇', 0x73}, {'큉', 0x74}, {'큐', 0x75}, {'큔', 0x76}, {'큘', 0x77}, {'큠', 0x78}, {'크', 0x79}, {'큭', 0x7A}, {'큰', 0x7B}, {'클', 0x7C}, {'큼', 0x7D}, {'큽', 0x7E}, {'킁', 0x7F},
{'키', 0x80}, {'킥', 0x81}, {'킨', 0x82}, {'킬', 0x83}, {'킴', 0x84}, {'킵', 0x85}, {'킷', 0x86}, {'킹', 0x87}, {'타', 0x88}, {'탁', 0x89}, {'탄', 0x8A}, {'탈', 0x8B}, {'탉', 0x8C}, {'탐', 0x8D}, {'탑', 0x8E}, {'탓', 0x8F},
{'탔', 0x90}, {'탕', 0x91}, {'태', 0x92}, {'택', 0x93}, {'탠', 0x94}, {'탤', 0x95}, {'탬', 0x96}, {'탭', 0x97}, {'탯', 0x98}, {'탰', 0x99}, {'탱', 0x9A}, {'탸', 0x9B}, {'턍', 0x9C}, {'터', 0x9D}, {'턱', 0x9E}, {'턴', 0x9F},
{'털', 0xA0}, {'턺', 0xA1}, {'텀', 0xA2}, {'텁', 0xA3}, {'텃', 0xA4}, {'텄', 0xA5}, {'텅', 0xA6}, {'테', 0xA7}, {'텍', 0xA8}, {'텐', 0xA9}, {'텔', 0xAA}, {'템', 0xAB}, {'텝', 0xAC}, {'텟', 0xAD}, {'텡', 0xAE}, {'텨', 0xAF},
{'텬', 0xB0}, {'텼', 0xB1}, {'톄', 0xB2}, {'톈', 0xB3}, {'토', 0xB4}, {'톡', 0xB5}, {'톤', 0xB6}, {'톨', 0xB7}, {'톰', 0xB8}, {'톱', 0xB9}, {'톳', 0xBA}, {'통', 0xBB}, {'톺', 0xBC}, {'톼', 0xBD}, {'퇀', 0xBE}, {'퇘', 0xBF},
{'퇴', 0xC0}, {'퇸', 0xC1}, {'툇', 0xC2}, {'툉', 0xC3}, {'툐', 0xC4}, {'투', 0xC5}, {'툭', 0xC6}, {'툰', 0xC7}, {'툴', 0xC8}, {'툼', 0xC9}, {'툽', 0xCA}, {'툿', 0xCB}, {'퉁', 0xCC}, {'퉈', 0xCD}, {'퉜', 0xCE},
{'퉤', 0xD1}, {'튀', 0xD2}, {'튁', 0xD3}, {'튄', 0xD4}, {'튈', 0xD5}, {'튐', 0xD6}, {'튑', 0xD7}, {'튕', 0xD8}, {'튜', 0xD9}, {'튠', 0xDA}, {'튤', 0xDB}, {'튬', 0xDC}, {'튱', 0xDD}, {'트', 0xDE}, {'특', 0xDF},
{'튼', 0xE0}, {'튿', 0xE1}, {'틀', 0xE2}, {'틂', 0xE3}, {'틈', 0xE4}, {'틉', 0xE5}, {'틋', 0xE6}, {'틔', 0xE7}, {'틘', 0xE8}, {'틜', 0xE9}, {'틤', 0xEA}, {'틥', 0xEB}, {'티', 0xEC}, {'틱', 0xED}, {'틴', 0xEE}, {'틸', 0xEF},
{'팀', 0xF0}, {'팁', 0xF1}, {'팃', 0xF2}, {'팅', 0xF3}, {'파', 0xF4}, {'팍', 0xF5}, {'팎', 0xF6}, {'판', 0xF7}, {'팔', 0xF8}, {'팖', 0xF9}, {'팜', 0xFA}, {'팝', 0xFB}, {'팟', 0xFC}, {'팠', 0xFD}, {'팡', 0xFE}, {'팥', 0xFF},
NULL, '치', '칙', '친', '칟', '칠', '칡', '침', '칩', '칫', '칭', '카', '칵', '칸', '칼', '캄',
'캅', '캇', '캉', '캐', '캑', '캔', '캘', '캠', '캡', '캣', '캤', '캥', '캬', '캭', '컁', '커',
'컥', '컨', '컫', '컬', '컴', '컵', '컷', '컸', '컹', '케', '켁', '켄', '켈', '켐', '켑', '켓',
'켕', '켜', '켠', '켤', '켬', '켭', '켯', '켰', '켱', '켸', '코', '콕', '콘', '콜', '콤', '콥',
'콧', '콩', '콰', '콱', '콴', '콸', '쾀', '쾅', '쾌', '쾡', '쾨', '쾰', '쿄', '쿠', '쿡', '쿤',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'쿨', '쿰', '쿱', '쿳', '쿵', '쿼', '퀀', '퀄', '퀑', '퀘', '퀭', '퀴', '퀵', '퀸', '퀼', NULL,
NULL, '큄', '큅', '큇', '큉', '큐', '큔', '큘', '큠', '크', '큭', '큰', '클', '큼', '큽', '킁',
'키', '킥', '킨', '킬', '킴', '킵', '킷', '킹', '타', '탁', '탄', '탈', '탉', '탐', '탑', '탓',
'탔', '탕', '태', '택', '탠', '탤', '탬', '탭', '탯', '탰', '탱', '탸', '턍', '터', '턱', '턴',
'털', '턺', '텀', '텁', '텃', '텄', '텅', '테', '텍', '텐', '텔', '템', '텝', '텟', '텡', '텨',
'텬', '텼', '톄', '톈', '토', '톡', '톤', '톨', '톰', '톱', '톳', '통', '톺', '톼', '퇀', '퇘',
'퇴', '퇸', '툇', '툉', '툐', '투', '툭', '툰', '툴', '툼', '툽', '툿', '퉁', '퉈', '퉜', NULL,
NULL, '퉤', '튀', '튁', '튄', '튈', '튐', '튑', '튕', '튜', '튠', '튤', '튬', '튱', '트', '특',
'튼', '튿', '틀', '틂', '틈', '틉', '틋', '틔', '틘', '틜', '틤', '틥', '티', '틱', '틴', '틸',
'팀', '팁', '팃', '팅', '파', '팍', '팎', '판', '팔', '팖', '팜', '팝', '팟', '팠', '팡', '팥',
};
private static readonly Dictionary<char, byte> U2GSC_KOR_A = new(256)
private static ReadOnlySpan<char> TableA => new[]
{
{'패', 0x00}, {'팩', 0x01}, {'팬', 0x02}, {'팰', 0x03}, {'팸', 0x04}, {'팹', 0x05}, {'팻', 0x06}, {'팼', 0x07}, {'팽', 0x08}, {'퍄', 0x09}, {'퍅', 0x0A}, {'퍼', 0x0B}, {'퍽', 0x0C}, {'펀', 0x0D}, {'펄', 0x0E}, {'펌', 0x0F},
{'펍', 0x10}, {'펏', 0x11}, {'펐', 0x12}, {'펑', 0x13}, {'페', 0x14}, {'펙', 0x15}, {'펜', 0x16}, {'펠', 0x17}, {'펨', 0x18}, {'펩', 0x19}, {'펫', 0x1A}, {'펭', 0x1B}, {'펴', 0x1C}, {'편', 0x1D}, {'펼', 0x1E}, {'폄', 0x1F},
{'폅', 0x20}, {'폈', 0x21}, {'평', 0x22}, {'폐', 0x23}, {'폘', 0x24}, {'폡', 0x25}, {'폣', 0x26}, {'포', 0x27}, {'폭', 0x28}, {'폰', 0x29}, {'폴', 0x2A}, {'폼', 0x2B}, {'폽', 0x2C}, {'폿', 0x2D}, {'퐁', 0x2E},
{'퐈', 0x31}, {'퐝', 0x32}, {'푀', 0x33}, {'푄', 0x34}, {'표', 0x35}, {'푠', 0x36}, {'푤', 0x37}, {'푭', 0x38}, {'푯', 0x39}, {'푸', 0x3A}, {'푹', 0x3B}, {'푼', 0x3C}, {'푿', 0x3D}, {'풀', 0x3E}, {'풂', 0x3F},
{'품', 0x40}, {'풉', 0x41}, {'풋', 0x42}, {'풍', 0x43}, {'풔', 0x44}, {'풩', 0x45}, {'퓌', 0x46}, {'퓐', 0x47}, {'퓔', 0x48}, {'퓜', 0x49}, {'퓟', 0x4A}, {'퓨', 0x4B}, {'퓬', 0x4C}, {'퓰', 0x4D}, {'퓸', 0x4E}, {'퓻', 0x4F},
{'퓽', 0x60}, {'프', 0x61}, {'픈', 0x62}, {'플', 0x63}, {'픔', 0x64}, {'픕', 0x65}, {'픗', 0x66}, {'피', 0x67}, {'픽', 0x68}, {'핀', 0x69}, {'필', 0x6A}, {'핌', 0x6B}, {'핍', 0x6C}, {'핏', 0x6D}, {'핑', 0x6E}, {'하', 0x6F},
{'학', 0x70}, {'한', 0x71}, {'할', 0x72}, {'핥', 0x73}, {'함', 0x74}, {'합', 0x75}, {'핫', 0x76}, {'항', 0x77}, {'해', 0x78}, {'핵', 0x79}, {'핸', 0x7A}, {'핼', 0x7B}, {'햄', 0x7C}, {'햅', 0x7D}, {'햇', 0x7E}, {'했', 0x7F},
{'행', 0x80}, {'햐', 0x81}, {'향', 0x82}, {'허', 0x83}, {'헉', 0x84}, {'헌', 0x85}, {'헐', 0x86}, {'헒', 0x87}, {'험', 0x88}, {'헙', 0x89}, {'헛', 0x8A}, {'헝', 0x8B}, {'헤', 0x8C}, {'헥', 0x8D}, {'헨', 0x8E}, {'헬', 0x8F},
{'헴', 0x90}, {'헵', 0x91}, {'헷', 0x92}, {'헹', 0x93}, {'혀', 0x94}, {'혁', 0x95}, {'현', 0x96}, {'혈', 0x97}, {'혐', 0x98}, {'협', 0x99}, {'혓', 0x9A}, {'혔', 0x9B}, {'형', 0x9C}, {'혜', 0x9D}, {'혠', 0x9E},
{'혤', 0xA1}, {'혭', 0xA2}, {'호', 0xA3}, {'혹', 0xA4}, {'혼', 0xA5}, {'홀', 0xA6}, {'홅', 0xA7}, {'홈', 0xA8}, {'홉', 0xA9}, {'홋', 0xAA}, {'홍', 0xAB}, {'홑', 0xAC}, {'화', 0xAD}, {'확', 0xAE}, {'환', 0xAF},
{'활', 0xB0}, {'홧', 0xB1}, {'황', 0xB2}, {'홰', 0xB3}, {'홱', 0xB4}, {'홴', 0xB5}, {'횃', 0xB6}, {'횅', 0xB7}, {'회', 0xB8}, {'획', 0xB9}, {'횐', 0xBA}, {'횔', 0xBB}, {'횝', 0xBC}, {'횟', 0xBD}, {'횡', 0xBE}, {'효', 0xBF},
{'횬', 0xC0}, {'횰', 0xC1}, {'횹', 0xC2}, {'횻', 0xC3}, {'후', 0xC4}, {'훅', 0xC5}, {'훈', 0xC6}, {'훌', 0xC7}, {'훑', 0xC8}, {'훔', 0xC9}, {'훗', 0xCA}, {'훙', 0xCB}, {'훠', 0xCC}, {'훤', 0xCD}, {'훨', 0xCE}, {'훰', 0xCF},
{'훵', 0xD0}, {'훼', 0xD1}, {'훽', 0xD2}, {'휀', 0xD3}, {'휄', 0xD4}, {'휑', 0xD5}, {'휘', 0xD6}, {'휙', 0xD7}, {'휜', 0xD8}, {'휠', 0xD9}, {'휨', 0xDA}, {'휩', 0xDB}, {'휫', 0xDC}, {'휭', 0xDD}, {'휴', 0xDE}, {'휵', 0xDF},
{'휸', 0xE0}, {'휼', 0xE1}, {'흄', 0xE2}, {'흇', 0xE3}, {'흉', 0xE4}, {'흐', 0xE5}, {'흑', 0xE6}, {'흔', 0xE7}, {'흖', 0xE8}, {'흗', 0xE9}, {'흘', 0xEA}, {'흙', 0xEB}, {'흠', 0xEC}, {'흡', 0xED}, {'흣', 0xEE}, {'흥', 0xEF},
{'흩', 0xF0}, {'희', 0xF1}, {'흰', 0xF2}, {'흴', 0xF3}, {'흼', 0xF4}, {'흽', 0xF5}, {'힁', 0xF6}, {'히', 0xF7}, {'힉', 0xF8}, {'힌', 0xF9}, {'힐', 0xFA}, {'힘', 0xFB}, {'힙', 0xFC}, {'힛', 0xFD}, {'힝', 0xFE},
'패', '팩', '팬', '팰', '팸', '팹', '팻', '팼', '팽', '퍄', '퍅', '퍼', '퍽', '펀', '펄', '펌',
'펍', '펏', '펐', '펑', '페', '펙', '펜', '펠', '펨', '펩', '펫', '펭', '펴', '편', '펼', '폄',
'폅', '폈', '평', '폐', '폘', '폡', '폣', '포', '폭', '폰', '폴', '폼', '폽', '폿', '퐁', NULL,
NULL, '퐈', '퐝', '푀', '푄', '표', '푠', '푤', '푭', '푯', '푸', '푹', '푼', '푿', '풀', '풂',
'품', '풉', '풋', '풍', '풔', '풩', '퓌', '퓐', '퓔', '퓜', '퓟', '퓨', '퓬', '퓰', '퓸', '퓻',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'퓽', '프', '픈', '플', '픔', '픕', '픗', '피', '픽', '핀', '필', '핌', '핍', '핏', '핑', '하',
'학', '한', '할', '핥', '함', '합', '핫', '항', '해', '핵', '핸', '핼', '햄', '햅', '햇', '했',
'행', '햐', '향', '허', '헉', '헌', '헐', '헒', '험', '헙', '헛', '헝', '헤', '헥', '헨', '헬',
'헴', '헵', '헷', '헹', '혀', '혁', '현', '혈', '혐', '협', '혓', '혔', '형', '혜', '혠', NULL,
NULL, '혤', '혭', '호', '혹', '혼', '홀', '홅', '홈', '홉', '홋', '홍', '홑', '화', '확', '환',
'활', '홧', '황', '홰', '홱', '홴', '횃', '횅', '회', '획', '횐', '횔', '횝', '횟', '횡', '효',
'횬', '횰', '횹', '횻', '후', '훅', '훈', '훌', '훑', '훔', '훗', '훙', '훠', '훤', '훨', '훰',
'훵', '훼', '훽', '휀', '휄', '휑', '휘', '휙', '휜', '휠', '휨', '휩', '휫', '휭', '휴', '휵',
'휸', '휼', '흄', '흇', '흉', '흐', '흑', '흔', '흖', '흗', '흘', '흙', '흠', '흡', '흣', '흥',
'흩', '희', '흰', '흴', '흼', '흽', '힁', '히', '힉', '힌', '힐', '힘', '힙', '힛', '힝', NULL,
};
private static readonly Dictionary<char, byte> U2GSC_KOR_B = U2GSC_KOR_0;
private static readonly Dictionary<byte, char> GSC2U_KOR_0 = new(80)
private static ReadOnlySpan<char> TableB => new[]
{
{0x00, 'ㄱ'}, {0x01, 'ㄴ'}, {0x02, 'ㄷ'}, {0x03, 'ㄹ'}, {0x04, 'ㅁ'}, {0x05, 'ㅂ'}, {0x06, 'ㅅ'}, {0x07, 'ㅇ'}, {0x08, 'ㅈ'}, {0x09, 'ㅊ'}, {0x0A, 'ㅋ'}, {0x0B, 'ㅌ'}, {0x0C, 'ㅍ'}, {0x0D, 'ㅎ'}, {0x0E, 'ㄲ'}, {0x0F, 'ㄸ'},
{0x10, 'ㅃ'}, {0x11, 'ㅆ'}, {0x12, 'ㅉ'},
{0x20, 'ㅏ'}, {0x21, 'ㅑ'}, {0x22, 'ㅓ'}, {0x23, 'ㅕ'}, {0x24, 'ㅗ'}, {0x25, 'ㅛ'}, {0x26, 'ㅜ'}, {0x27, 'ㅠ'}, {0x28, 'ㅡ'}, {0x29, 'ㅣ'}, {0x2A, 'ㅐ'}, {0x2B, 'ㅒ'}, {0x2C, 'ㅔ'}, {0x2D, 'ㅖ'}, {0x2E, 'ㅘ'}, {0x2F, 'ㅙ'},
{0x30, 'ㅚ'}, {0x31, 'ㅝ'}, {0x32, 'ㅞ'}, {0x33, 'ㅟ'}, {0x34, 'ㅢ'}, {0x3E, '_'}, {0x3F, '—'},
{0x60, '「'}, {0x61, '」'}, {0x62, '『'}, {0x63, '』'}, {0x64, '('}, {0x65, ')'}, {0x66, '!'}, {0x67, '?'}, {0x68, '-'}, {0x69, '~'}, {0x6A, '…'}, {0x6B, ','}, {0x6C, '.'}, // . is 0x6D for bank
{0xF0, ''}, {0xF1, ''}, {0xF2, ''}, {0xF3, ''}, {0xF4, ''}, {0xF5, ''}, {0xF6, ''}, {0xF7, ''}, {0xF8, ''}, {0xF9, ''},
{0xFF, '\u3000'},
'ㄱ', 'ㄴ', 'ㄷ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅅ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ', 'ㄲ', 'ㄸ',
'ㅃ', 'ㅆ', 'ㅉ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'ㅏ', 'ㅑ', 'ㅓ', 'ㅕ', 'ㅗ', 'ㅛ', 'ㅜ', 'ㅠ', 'ㅡ', 'ㅣ', 'ㅐ', 'ㅒ', 'ㅔ', 'ㅖ', 'ㅘ', 'ㅙ',
'ㅚ', 'ㅝ', 'ㅞ', 'ㅟ', 'ㅢ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '_', '—',
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'「', '」', '『', '』', '(', ')', '!', '?', '-', '~', '…', ',', '.', NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'', '', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, ' ',
};
private static readonly Dictionary<byte, char> GSC2U_KOR_1 = new(256)
// In transporter's code, none of these glyphs are legitimately accessible via keyboard.
private const char NUL = NULL;
private static ReadOnlySpan<char> Table0 => new[]
{
{0x01, '가'}, {0x02, '각'}, {0x03, '간'}, {0x04, '갇'}, {0x05, '갈'}, {0x06, '갉'}, {0x07, '갊'}, {0x08, '감'}, {0x09, '갑'}, {0x0A, '값'}, {0x0B, '갓'}, {0x0C, '갔'}, {0x0D, '강'}, {0x0E, '갖'}, {0x0F, '갗'},
{0x10, '같'}, {0x11, '갚'}, {0x12, '갛'}, {0x13, '개'}, {0x14, '객'}, {0x15, '갠'}, {0x16, '갤'}, {0x17, '갬'}, {0x18, '갭'}, {0x19, '갯'}, {0x1A, '갰'}, {0x1B, '갱'}, {0x1C, '갸'}, {0x1D, '갹'}, {0x1E, '갼'}, {0x1F, '걀'},
{0x20, '걋'}, {0x21, '걍'}, {0x22, '걔'}, {0x23, '걘'}, {0x24, '걜'}, {0x25, '거'}, {0x26, '걱'}, {0x27, '건'}, {0x28, '걷'}, {0x29, '걸'}, {0x2A, '걺'}, {0x2B, '검'}, {0x2C, '겁'}, {0x2D, '것'}, {0x2E, '겄'}, {0x2F, '겅'},
{0x30, '겆'}, {0x31, '겉'}, {0x32, '겊'}, {0x33, '겋'}, {0x34, '게'}, {0x35, '겐'}, {0x36, '겔'}, {0x37, '겜'}, {0x38, '겝'}, {0x39, '겟'}, {0x3A, '겠'}, {0x3B, '겡'}, {0x3C, '겨'}, {0x3D, '격'}, {0x3E, '겪'}, {0x3F, '견'},
{0x40, '겯'}, {0x41, '결'}, {0x42, '겹'}, {0x43, '겸'}, {0x44, '겻'}, {0x45, '겼'}, {0x46, '경'}, {0x47, '곁'}, {0x48, '계'}, {0x49, '곈'}, {0x4A, '곌'}, {0x4B, '곕'}, {0x4C, '곗'}, {0x4D, '고'}, {0x4E, '곡'}, {0x4F, '곤'},
{0x60, '곧'}, {0x61, '골'}, {0x62, '곪'}, {0x63, '곬'}, {0x64, '곯'}, {0x65, '곰'}, {0x66, '곱'}, {0x67, '곳'}, {0x68, '공'}, {0x69, '곶'}, {0x6A, '과'}, {0x6B, '곽'}, {0x6C, '관'}, {0x6D, '괄'}, {0x6E, '괆'},
{0x71, '괌'}, {0x72, '괍'}, {0x73, '괏'}, {0x74, '광'}, {0x75, '괘'}, {0x76, '괜'}, {0x77, '괠'}, {0x78, '괩'}, {0x79, '괬'}, {0x7A, '괭'}, {0x7B, '괴'}, {0x7C, '괵'}, {0x7D, '괸'}, {0x7E, '괼'}, {0x7F, '괻'},
{0x80, '굅'}, {0x81, '굇'}, {0x82, '굉'}, {0x83, '교'}, {0x84, '굔'}, {0x85, '굘'}, {0x86, '굡'}, {0x87, '굣'}, {0x88, '구'}, {0x89, '국'}, {0x8A, '군'}, {0x8B, '굳'}, {0x8C, '굴'}, {0x8D, '굵'}, {0x8E, '굶'}, {0x8F, '굻'},
{0x90, '굼'}, {0x91, '굽'}, {0x92, '굿'}, {0x93, '궁'}, {0x94, '궂'}, {0x95, '궈'}, {0x96, '궉'}, {0x97, '권'}, {0x98, '궐'}, {0x99, '궜'}, {0x9A, '궝'}, {0x9B, '궤'}, {0x9C, '궷'}, {0x9D, '귀'}, {0x9E, '귁'}, {0x9F, '귄'},
{0xA0, '귈'}, {0xA1, '귐'}, {0xA2, '귑'}, {0xA3, '귓'}, {0xA4, '규'}, {0xA5, '균'}, {0xA6, '귤'}, {0xA7, '그'}, {0xA8, '극'}, {0xA9, '근'}, {0xAA, '귿'}, {0xAB, '글'}, {0xAC, '긁'}, {0xAD, '금'}, {0xAE, '급'}, {0xAF, '긋'},
{0xB0, '긍'}, {0xB1, '긔'}, {0xB2, '기'}, {0xB3, '긱'}, {0xB4, '긴'}, {0xB5, '긷'}, {0xB6, '길'}, {0xB7, '긺'}, {0xB8, '김'}, {0xB9, '깁'}, {0xBA, '깃'}, {0xBB, '깅'}, {0xBC, '깆'}, {0xBD, '깊'}, {0xBE, '까'}, {0xBF, '깍'},
{0xC0, '깎'}, {0xC1, '깐'}, {0xC2, '깔'}, {0xC3, '깖'}, {0xC4, '깜'}, {0xC5, '깝'}, {0xC6, '깟'}, {0xC7, '깠'}, {0xC8, '깡'}, {0xC9, '깥'}, {0xCA, '깨'}, {0xCB, '깩'}, {0xCC, '깬'}, {0xCD, '깰'}, {0xCE, '깸'},
{0xD1, '깹'}, {0xD2, '깻'}, {0xD3, '깼'}, {0xD4, '깽'}, {0xD5, '꺄'}, {0xD6, '꺅'}, {0xD7, '꺌'}, {0xD8, '꺼'}, {0xD9, '꺽'}, {0xDA, '꺾'}, {0xDB, '껀'}, {0xDC, '껄'}, {0xDD, '껌'}, {0xDE, '껍'}, {0xDF, '껏'},
{0xE0, '껐'}, {0xE1, '껑'}, {0xE2, '께'}, {0xE3, '껙'}, {0xE4, '껜'}, {0xE5, '껨'}, {0xE6, '껫'}, {0xE7, '껭'}, {0xE8, '껴'}, {0xE9, '껸'}, {0xEA, '껼'}, {0xEB, '꼇'}, {0xEC, '꼈'}, {0xED, '꼍'}, {0xEE, '꼐'}, {0xEF, '꼬'},
{0xF0, '꼭'}, {0xF1, '꼰'}, {0xF2, '꼲'}, {0xF3, '꼴'}, {0xF4, '꼼'}, {0xF5, '꼽'}, {0xF6, '꼿'}, {0xF7, '꽁'}, {0xF8, '꽂'}, {0xF9, '꽃'}, {0xFA, '꽈'}, {0xFB, '꽉'}, {0xFC, '꽐'}, {0xFD, '꽜'}, {0xFE, '꽝'}, {0xFF, '꽤'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_2 = new(256)
{
{0x00, '꽥'}, {0x01, '꽹'}, {0x02, '꾀'}, {0x03, '꾄'}, {0x04, '꾈'}, {0x05, '꾐'}, {0x06, '꾑'}, {0x07, '꾕'}, {0x08, '꾜'}, {0x09, '꾸'}, {0x0A, '꾹'}, {0x0B, '꾼'}, {0x0C, '꿀'}, {0x0D, '꿇'}, {0x0E, '꿈'}, {0x0F, '꿉'},
{0x10, '꿋'}, {0x11, '꿍'}, {0x12, '꿎'}, {0x13, '꿔'}, {0x14, '꿜'}, {0x15, '꿨'}, {0x16, '꿩'}, {0x17, '꿰'}, {0x18, '꿱'}, {0x19, '꿴'}, {0x1A, '꿸'}, {0x1B, '뀀'}, {0x1C, '뀁'}, {0x1D, '뀄'}, {0x1E, '뀌'}, {0x1F, '뀐'},
{0x20, '뀔'}, {0x21, '뀜'}, {0x22, '뀝'}, {0x23, '뀨'}, {0x24, '끄'}, {0x25, '끅'}, {0x26, '끈'}, {0x27, '끊'}, {0x28, '끌'}, {0x29, '끎'}, {0x2A, '끓'}, {0x2B, '끔'}, {0x2C, '끕'}, {0x2D, '끗'}, {0x2E, '끙'},
{0x31, '끝'}, {0x32, '끼'}, {0x33, '끽'}, {0x34, '낀'}, {0x35, '낄'}, {0x36, '낌'}, {0x37, '낍'}, {0x38, '낏'}, {0x39, '낑'}, {0x3A, '나'}, {0x3B, '낙'}, {0x3C, '낚'}, {0x3D, '난'}, {0x3E, '낟'}, {0x3F, '날'},
{0x40, '낡'}, {0x41, '낢'}, {0x42, '남'}, {0x43, '납'}, {0x44, '낫'}, {0x45, '났'}, {0x46, '낭'}, {0x47, '낮'}, {0x48, '낯'}, {0x49, '낱'}, {0x4A, '낳'}, {0x4B, '내'}, {0x4C, '낵'}, {0x4D, '낸'}, {0x4E, '낼'}, {0x4F, '냄'},
{0x60, '냅'}, {0x61, '냇'}, {0x62, '냈'}, {0x63, '냉'}, {0x64, '냐'}, {0x65, '냑'}, {0x66, '냔'}, {0x67, '냘'}, {0x68, '냠'}, {0x69, '냥'}, {0x6A, '너'}, {0x6B, '넉'}, {0x6C, '넋'}, {0x6D, '넌'}, {0x6E, '널'}, {0x6F, '넒'},
{0x70, '넓'}, {0x71, '넘'}, {0x72, '넙'}, {0x73, '넛'}, {0x74, '넜'}, {0x75, '넝'}, {0x76, '넣'}, {0x77, '네'}, {0x78, '넥'}, {0x79, '넨'}, {0x7A, '넬'}, {0x7B, '넴'}, {0x7C, '넵'}, {0x7D, '넷'}, {0x7E, '넸'}, {0x7F, '넹'},
{0x80, '녀'}, {0x81, '녁'}, {0x82, '년'}, {0x83, '녈'}, {0x84, '념'}, {0x85, '녑'}, {0x86, '녔'}, {0x87, '녕'}, {0x88, '녘'}, {0x89, '녜'}, {0x8A, '녠'}, {0x8B, '노'}, {0x8C, '녹'}, {0x8D, '논'}, {0x8E, '놀'}, {0x8F, '놂'},
{0x90, '놈'}, {0x91, '놉'}, {0x92, '놋'}, {0x93, '농'}, {0x94, '높'}, {0x95, '놓'}, {0x96, '놔'}, {0x97, '놘'}, {0x98, '놜'}, {0x99, '놨'}, {0x9A, '뇌'}, {0x9B, '뇐'}, {0x9C, '뇔'}, {0x9D, '뇜'}, {0x9E, '뇝'},
{0xA1, '뇟'}, {0xA2, '뇨'}, {0xA3, '뇩'}, {0xA4, '뇬'}, {0xA5, '뇰'}, {0xA6, '뇹'}, {0xA7, '뇻'}, {0xA8, '뇽'}, {0xA9, '누'}, {0xAA, '눅'}, {0xAB, '눈'}, {0xAC, '눋'}, {0xAD, '눌'}, {0xAE, '눔'}, {0xAF, '눕'},
{0xB0, '눗'}, {0xB1, '눙'}, {0xB2, '눠'}, {0xB3, '눴'}, {0xB4, '눼'}, {0xB5, '뉘'}, {0xB6, '뉜'}, {0xB7, '뉠'}, {0xB8, '뉨'}, {0xB9, '뉩'}, {0xBA, '뉴'}, {0xBB, '뉵'}, {0xBC, '뉼'}, {0xBD, '늄'}, {0xBE, '늅'}, {0xBF, '늉'},
{0xC0, '느'}, {0xC1, '늑'}, {0xC2, '는'}, {0xC3, '늘'}, {0xC4, '늙'}, {0xC5, '늚'}, {0xC6, '늠'}, {0xC7, '늡'}, {0xC8, '늣'}, {0xC9, '능'}, {0xCA, '늦'}, {0xCB, '늪'}, {0xCC, '늬'}, {0xCD, '늰'}, {0xCE, '늴'}, {0xCF, '니'},
{0xD0, '닉'}, {0xD1, '닌'}, {0xD2, '닐'}, {0xD3, '닒'}, {0xD4, '님'}, {0xD5, '닙'}, {0xD6, '닛'}, {0xD7, '닝'}, {0xD8, '닢'}, {0xD9, '다'}, {0xDA, '닥'}, {0xDB, '닦'}, {0xDC, '단'}, {0xDD, '닫'}, {0xDE, '달'}, {0xDF, '닭'},
{0xE0, '닮'}, {0xE1, '닯'}, {0xE2, '닳'}, {0xE3, '담'}, {0xE4, '답'}, {0xE5, '닷'}, {0xE6, '닸'}, {0xE7, '당'}, {0xE8, '닺'}, {0xE9, '닻'}, {0xEA, '닿'}, {0xEB, '대'}, {0xEC, '댁'}, {0xED, '댄'}, {0xEE, '댈'}, {0xEF, '댐'},
{0xF0, '댑'}, {0xF1, '댓'}, {0xF2, '댔'}, {0xF3, '댕'}, {0xF5, '더'}, {0xF6, '덕'}, {0xF7, '덖'}, {0xF8, '던'}, {0xF9, '덛'}, {0xFA, '덜'}, {0xFB, '덞'}, {0xFC, '덟'}, {0xFD, '덤'}, {0xFE, '덥'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_3 = new(256)
{
{0x01, '덧'}, {0x02, '덩'}, {0x03, '덫'}, {0x04, '덮'}, {0x05, '데'}, {0x06, '덱'}, {0x07, '덴'}, {0x08, '델'}, {0x09, '뎀'}, {0x0A, '뎁'}, {0x0B, '뎃'}, {0x0C, '뎄'}, {0x0D, '뎅'}, {0x0E, '뎌'}, {0x0F, '뎐'},
{0x10, '뎔'}, {0x11, '뎠'}, {0x12, '뎡'}, {0x13, '뎨'}, {0x14, '뎬'}, {0x15, '도'}, {0x16, '독'}, {0x17, '돈'}, {0x18, '돋'}, {0x19, '돌'}, {0x1A, '돎'}, {0x1C, '돔'}, {0x1D, '돕'}, {0x1E, '돗'}, {0x1F, '동'},
{0x20, '돛'}, {0x21, '돝'}, {0x22, '돠'}, {0x23, '돤'}, {0x24, '돨'}, {0x25, '돼'}, {0x26, '됐'}, {0x27, '되'}, {0x28, '된'}, {0x29, '될'}, {0x2A, '됨'}, {0x2B, '됩'}, {0x2C, '됫'}, {0x2D, '됴'}, {0x2E, '두'}, {0x2F, '둑'},
{0x30, '둔'}, {0x31, '둘'}, {0x32, '둠'}, {0x33, '둡'}, {0x34, '둣'}, {0x35, '둥'}, {0x36, '둬'}, {0x37, '뒀'}, {0x38, '뒈'}, {0x39, '뒝'}, {0x3A, '뒤'}, {0x3B, '뒨'}, {0x3C, '뒬'}, {0x3D, '뒵'}, {0x3E, '뒷'}, {0x3F, '뒹'},
{0x40, '듀'}, {0x41, '듄'}, {0x42, '듈'}, {0x43, '듐'}, {0x44, '듕'}, {0x45, '드'}, {0x46, '득'}, {0x47, '든'}, {0x48, '듣'}, {0x49, '들'}, {0x4A, '듦'}, {0x4B, '듬'}, {0x4C, '듭'}, {0x4D, '듯'}, {0x4E, '등'}, {0x4F, '듸'},
{0x60, '디'}, {0x61, '딕'}, {0x62, '딘'}, {0x63, '딛'}, {0x64, '딜'}, {0x65, '딤'}, {0x66, '딥'}, {0x67, '딧'}, {0x68, '딨'}, {0x69, '딩'}, {0x6A, '딪'}, {0x6B, '따'}, {0x6C, '딱'}, {0x6D, '딴'}, {0x6E, '딸'},
{0x71, '땀'}, {0x72, '땁'}, {0x73, '땃'}, {0x74, '땄'}, {0x75, '땅'}, {0x76, '땋'}, {0x77, '때'}, {0x78, '땍'}, {0x79, '땐'}, {0x7A, '땔'}, {0x7B, '땜'}, {0x7C, '땝'}, {0x7D, '땟'}, {0x7E, '땠'}, {0x7F, '땡'},
{0x80, '떠'}, {0x81, '떡'}, {0x82, '떤'}, {0x83, '떨'}, {0x84, '떪'}, {0x85, '떫'}, {0x86, '떰'}, {0x87, '떱'}, {0x88, '떳'}, {0x89, '떴'}, {0x8A, '떵'}, {0x8B, '떻'}, {0x8C, '떼'}, {0x8D, '떽'}, {0x8E, '뗀'}, {0x8F, '뗄'},
{0x90, '뗌'}, {0x91, '뗍'}, {0x92, '뗏'}, {0x93, '뗐'}, {0x94, '뗑'}, {0x95, '뗘'}, {0x96, '뗬'}, {0x97, '또'}, {0x98, '똑'}, {0x99, '똔'}, {0x9A, '똘'}, {0x9B, '똥'}, {0x9C, '똬'}, {0x9D, '똴'}, {0x9E, '뙈'}, {0x9F, '뙤'},
{0xA0, '뙨'}, {0xA1, '뚜'}, {0xA2, '뚝'}, {0xA3, '뚠'}, {0xA4, '뚤'}, {0xA5, '뚫'}, {0xA6, '뚬'}, {0xA7, '뚱'}, {0xA8, '뛔'}, {0xA9, '뛰'}, {0xAA, '뛴'}, {0xAB, '뛸'}, {0xAC, '뜀'}, {0xAD, '뜁'}, {0xAE, '뜅'}, {0xAF, '뜨'},
{0xB0, '뜩'}, {0xB1, '뜬'}, {0xB2, '뜯'}, {0xB3, '뜰'}, {0xB4, '뜸'}, {0xB5, '뜹'}, {0xB6, '뜻'}, {0xB7, '띄'}, {0xB8, '띈'}, {0xB9, '띌'}, {0xBA, '띔'}, {0xBB, '띕'}, {0xBC, '띠'}, {0xBD, '띤'}, {0xBE, '띨'}, {0xBF, '띰'},
{0xC0, '띱'}, {0xC1, '띳'}, {0xC2, '띵'}, {0xC3, '라'}, {0xC4, '락'}, {0xC5, '란'}, {0xC6, '랄'}, {0xC7, '람'}, {0xC8, '랍'}, {0xC9, '랏'}, {0xCA, '랐'}, {0xCB, '랑'}, {0xCC, '랒'}, {0xCD, '랖'}, {0xCE, '랗'},
{0xD0, '뢔'}, {0xD1, '래'}, {0xD2, '랙'}, {0xD3, '랜'}, {0xD4, '랠'}, {0xD5, '램'}, {0xD6, '랩'}, {0xD7, '랫'}, {0xD8, '랬'}, {0xD9, '랭'}, {0xDA, '랴'}, {0xDB, '략'}, {0xDC, '랸'}, {0xDD, '럇'}, {0xDE, '량'}, {0xDF, '러'},
{0xE0, '럭'}, {0xE1, '런'}, {0xE2, '럴'}, {0xE3, '럼'}, {0xE4, '럽'}, {0xE5, '럿'}, {0xE6, '렀'}, {0xE7, '렁'}, {0xE8, '렇'}, {0xE9, '레'}, {0xEA, '렉'}, {0xEB, '렌'}, {0xEC, '렐'}, {0xED, '렘'}, {0xEE, '렙'}, {0xEF, '렛'},
{0xF0, '렝'}, {0xF1, '려'}, {0xF2, '력'}, {0xF3, '련'}, {0xF4, '렬'}, {0xF5, '렴'}, {0xF6, '렵'}, {0xF7, '렷'}, {0xF8, '렸'}, {0xF9, '령'}, {0xFA, '례'}, {0xFB, '롄'}, {0xFC, '롑'}, {0xFD, '롓'}, {0xFE, '로'}, {0xFF, '록'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_4 = new(256)
{
{0x00, '론'}, {0x01, '롤'}, {0x02, '롬'}, {0x03, '롭'}, {0x04, '롯'}, {0x05, '롱'}, {0x06, '롸'}, {0x07, '롼'}, {0x08, '뢍'}, {0x09, '뢨'}, {0x0A, '뢰'}, {0x0B, '뢴'}, {0x0C, '뢸'}, {0x0D, '룀'}, {0x0E, '룁'}, {0x0F, '룃'},
{0x10, '룅'}, {0x11, '료'}, {0x12, '룐'}, {0x13, '룔'}, {0x14, '룝'}, {0x15, '룟'}, {0x16, '룡'}, {0x17, '루'}, {0x18, '룩'}, {0x19, '룬'}, {0x1A, '룰'}, {0x1B, '룸'}, {0x1C, '룹'}, {0x1D, '룻'}, {0x1E, '룽'}, {0x1F, '뤄'},
{0x20, '뤘'}, {0x21, '뤠'}, {0x22, '뤼'}, {0x23, '뤽'}, {0x24, '륀'}, {0x25, '륄'}, {0x26, '륌'}, {0x27, '륏'}, {0x28, '륑'}, {0x29, '류'}, {0x2A, '륙'}, {0x2B, '륜'}, {0x2C, '률'}, {0x2D, '륨'}, {0x2E, '륩'},
{0x31, '륫'}, {0x32, '륭'}, {0x33, '르'}, {0x34, '륵'}, {0x35, '른'}, {0x36, '를'}, {0x37, '름'}, {0x38, '릅'}, {0x39, '릇'}, {0x3A, '릉'}, {0x3B, '릊'}, {0x3C, '릍'}, {0x3D, '릎'}, {0x3E, '리'}, {0x3F, '릭'},
{0x40, '린'}, {0x41, '릴'}, {0x42, '림'}, {0x43, '립'}, {0x44, '릿'}, {0x45, '링'}, {0x46, '마'}, {0x47, '막'}, {0x48, '만'}, {0x49, '많'}, {0x4A, '맏'}, {0x4B, '말'}, {0x4C, '맑'}, {0x4D, '맒'}, {0x4E, '맘'}, {0x4F, '맙'},
{0x60, '맛'}, {0x61, '망'}, {0x62, '맞'}, {0x63, '맡'}, {0x64, '맣'}, {0x65, '매'}, {0x66, '맥'}, {0x67, '맨'}, {0x68, '맬'}, {0x69, '맴'}, {0x6A, '맵'}, {0x6B, '맷'}, {0x6C, '맸'}, {0x6D, '맹'}, {0x6E, '맺'}, {0x6F, '먀'},
{0x70, '먁'}, {0x71, '먈'}, {0x72, '먕'}, {0x73, '머'}, {0x74, '먹'}, {0x75, '먼'}, {0x76, '멀'}, {0x77, '멂'}, {0x78, '멈'}, {0x79, '멉'}, {0x7A, '멋'}, {0x7B, '멍'}, {0x7C, '멎'}, {0x7D, '멓'}, {0x7E, '메'}, {0x7F, '멕'},
{0x80, '멘'}, {0x81, '멜'}, {0x82, '멤'}, {0x83, '멥'}, {0x84, '멧'}, {0x85, '멨'}, {0x86, '멩'}, {0x87, '며'}, {0x88, '멱'}, {0x89, '면'}, {0x8A, '멸'}, {0x8B, '몃'}, {0x8C, '몄'}, {0x8D, '명'}, {0x8E, '몇'}, {0x8F, '몌'},
{0x90, '모'}, {0x91, '목'}, {0x92, '몫'}, {0x93, '몬'}, {0x94, '몰'}, {0x95, '몲'}, {0x96, '몸'}, {0x97, '몹'}, {0x98, '못'}, {0x99, '몽'}, {0x9A, '뫄'}, {0x9B, '뫈'}, {0x9C, '뫘'}, {0x9D, '뫙'}, {0x9E, '뫼'},
{0xA1, '묀'}, {0xA2, '묄'}, {0xA3, '묍'}, {0xA4, '묏'}, {0xA5, '묑'}, {0xA6, '묘'}, {0xA7, '묜'}, {0xA8, '묠'}, {0xA9, '묩'}, {0xAA, '묫'}, {0xAB, '무'}, {0xAC, '묵'}, {0xAD, '묶'}, {0xAE, '문'}, {0xAF, '묻'},
{0xB0, '물'}, {0xB1, '묽'}, {0xB2, '묾'}, {0xB3, '뭄'}, {0xB4, '뭅'}, {0xB5, '뭇'}, {0xB6, '뭉'}, {0xB7, '뭍'}, {0xB8, '뭏'}, {0xB9, '뭐'}, {0xBA, '뭔'}, {0xBB, '뭘'}, {0xBC, '뭡'}, {0xBD, '뭣'}, {0xBE, '뭬'}, {0xBF, '뮈'},
{0xC0, '뮌'}, {0xC1, '뮐'}, {0xC2, '뮤'}, {0xC3, '뮨'}, {0xC4, '뮬'}, {0xC5, '뮴'}, {0xC6, '뮷'}, {0xC7, '므'}, {0xC8, '믄'}, {0xC9, '믈'}, {0xCA, '믐'}, {0xCB, '믓'}, {0xCC, '미'}, {0xCD, '믹'}, {0xCE, '민'}, {0xCF, '믿'},
{0xD0, '밀'}, {0xD1, '밂'}, {0xD2, '밈'}, {0xD3, '밉'}, {0xD4, '밋'}, {0xD5, '밌'}, {0xD6, '밍'}, {0xD7, '및'}, {0xD8, '밑'}, {0xD9, '바'}, {0xDA, '박'}, {0xDB, '밖'}, {0xDC, '밗'}, {0xDD, '반'}, {0xDE, '받'}, {0xDF, '발'},
{0xE0, '밝'}, {0xE1, '밞'}, {0xE2, '밟'}, {0xE3, '밤'}, {0xE4, '밥'}, {0xE5, '밧'}, {0xE6, '방'}, {0xE7, '밭'}, {0xE8, '배'}, {0xE9, '백'}, {0xEA, '밴'}, {0xEB, '밸'}, {0xEC, '뱀'}, {0xED, '뱁'}, {0xEE, '뱃'}, {0xEF, '뱄'},
{0xF0, '뱅'}, {0xF1, '뱉'}, {0xF2, '뱌'}, {0xF3, '뱍'}, {0xF4, '뱐'}, {0xF5, '뱝'}, {0xF6, '버'}, {0xF7, '벅'}, {0xF8, '번'}, {0xF9, '벋'}, {0xFA, '벌'}, {0xFB, '벎'}, {0xFC, '범'}, {0xFD, '법'}, {0xFE, '벗'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_5 = new(256)
{
{0x01, '벙'}, {0x02, '벚'}, {0x03, '베'}, {0x04, '벡'}, {0x05, '벤'}, {0x06, '벧'}, {0x07, '벨'}, {0x08, '벰'}, {0x09, '벱'}, {0x0A, '벳'}, {0x0B, '벴'}, {0x0C, '벵'}, {0x0D, '벼'}, {0x0E, '벽'}, {0x0F, '변'},
{0x10, '별'}, {0x11, '볍'}, {0x12, '볏'}, {0x13, '볐'}, {0x14, '병'}, {0x15, '볕'}, {0x16, '볘'}, {0x17, '볜'}, {0x18, '보'}, {0x19, '복'}, {0x1A, '볶'}, {0x1B, '본'}, {0x1C, '볼'}, {0x1D, '봄'}, {0x1E, '봅'}, {0x1F, '봇'},
{0x20, '봉'}, {0x21, '봐'}, {0x22, '봔'}, {0x23, '봤'}, {0x24, '봬'}, {0x25, '뵀'}, {0x26, '뵈'}, {0x27, '뵉'}, {0x28, '뵌'}, {0x29, '뵐'}, {0x2A, '뵘'}, {0x2B, '뵙'}, {0x2C, '뵤'}, {0x2D, '뵨'}, {0x2E, '부'}, {0x2F, '북'},
{0x30, '분'}, {0x31, '붇'}, {0x32, '불'}, {0x33, '붉'}, {0x34, '붊'}, {0x35, '붐'}, {0x36, '붑'}, {0x37, '붓'}, {0x38, '붕'}, {0x39, '붙'}, {0x3A, '붚'}, {0x3B, '붜'}, {0x3C, '붤'}, {0x3D, '붰'}, {0x3E, '붸'}, {0x3F, '뷔'},
{0x40, '뷕'}, {0x41, '뷘'}, {0x42, '뷜'}, {0x43, '뷩'}, {0x44, '뷰'}, {0x45, '뷴'}, {0x46, '뷸'}, {0x47, '븀'}, {0x48, '븃'}, {0x49, '븅'}, {0x4A, '브'}, {0x4B, '븍'}, {0x4C, '븐'}, {0x4D, '블'}, {0x4E, '븜'}, {0x4F, '븝'},
{0x60, '븟'}, {0x61, '비'}, {0x62, '빅'}, {0x63, '빈'}, {0x64, '빌'}, {0x65, '빎'}, {0x66, '빔'}, {0x67, '빕'}, {0x68, '빗'}, {0x69, '빙'}, {0x6A, '빚'}, {0x6B, '빛'}, {0x6C, '빠'}, {0x6D, '빡'}, {0x6E, '빤'},
{0x71, '빨'}, {0x72, '빪'}, {0x73, '빰'}, {0x74, '빱'}, {0x75, '빳'}, {0x76, '빴'}, {0x77, '빵'}, {0x78, '빻'}, {0x79, '빼'}, {0x7A, '빽'}, {0x7B, '뺀'}, {0x7C, '뺄'}, {0x7D, '뺌'}, {0x7E, '뺍'}, {0x7F, '뺏'},
{0x80, '뺐'}, {0x81, '뺑'}, {0x82, '뺘'}, {0x83, '뺙'}, {0x84, '뺨'}, {0x85, '뻐'}, {0x86, '뻑'}, {0x87, '뻔'}, {0x88, '뻗'}, {0x89, '뻘'}, {0x8A, '뻠'}, {0x8B, '뻣'}, {0x8C, '뻤'}, {0x8D, '뻥'}, {0x8E, '뻬'}, {0x8F, '뼁'},
{0x90, '뼈'}, {0x91, '뼉'}, {0x92, '뼘'}, {0x93, '뼙'}, {0x94, '뼛'}, {0x95, '뼜'}, {0x96, '뼝'}, {0x97, '뽀'}, {0x98, '뽁'}, {0x99, '뽄'}, {0x9A, '뽈'}, {0x9B, '뽐'}, {0x9C, '뽑'}, {0x9D, '뽕'}, {0x9E, '뾔'}, {0x9F, '뾰'},
{0xA0, '뿅'}, {0xA1, '뿌'}, {0xA2, '뿍'}, {0xA3, '뿐'}, {0xA4, '뿔'}, {0xA5, '뿜'}, {0xA6, '뿟'}, {0xA7, '뿡'}, {0xA8, '쀼'}, {0xA9, '쁑'}, {0xAA, '쁘'}, {0xAB, '쁜'}, {0xAC, '쁠'}, {0xAD, '쁨'}, {0xAE, '쁩'}, {0xAF, '삐'},
{0xB0, '삑'}, {0xB1, '삔'}, {0xB2, '삘'}, {0xB3, '삠'}, {0xB4, '삡'}, {0xB5, '삣'}, {0xB6, '삥'}, {0xB7, '사'}, {0xB8, '삭'}, {0xB9, '삯'}, {0xBA, '산'}, {0xBB, '삳'}, {0xBC, '살'}, {0xBD, '삵'}, {0xBE, '삶'}, {0xBF, '삼'},
{0xC0, '삽'}, {0xC1, '삿'}, {0xC2, '샀'}, {0xC3, '상'}, {0xC4, '샅'}, {0xC5, '새'}, {0xC6, '색'}, {0xC7, '샌'}, {0xC8, '샐'}, {0xC9, '샘'}, {0xCA, '샙'}, {0xCB, '샛'}, {0xCC, '샜'}, {0xCD, '생'}, {0xCE, '샤'},
{0xD1, '샥'}, {0xD2, '샨'}, {0xD3, '샬'}, {0xD4, '샴'}, {0xD5, '샵'}, {0xD6, '샷'}, {0xD7, '샹'}, {0xD8, '섀'}, {0xD9, '섄'}, {0xDA, '섈'}, {0xDB, '섐'}, {0xDC, '섕'}, {0xDD, '서'}, {0xDE, '석'}, {0xDF, '섞'},
{0xE0, '섟'}, {0xE1, '선'}, {0xE2, '섣'}, {0xE3, '설'}, {0xE4, '섦'}, {0xE5, '섧'}, {0xE6, '섬'}, {0xE7, '섭'}, {0xE8, '섯'}, {0xE9, '섰'}, {0xEA, '성'}, {0xEB, '섶'}, {0xEC, '세'}, {0xED, '섹'}, {0xEE, '센'}, {0xEF, '셀'},
{0xF0, '셈'}, {0xF1, '셉'}, {0xF2, '셋'}, {0xF3, '셌'}, {0xF4, '셍'}, {0xF5, '셔'}, {0xF6, '셕'}, {0xF7, '션'}, {0xF8, '셜'}, {0xF9, '셤'}, {0xFA, '셥'}, {0xFB, '셧'}, {0xFC, '셨'}, {0xFD, '셩'}, {0xFE, '셰'}, {0xFF, '셴'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_6 = new(256)
{
{0x00, '셸'}, {0x01, '솅'}, {0x02, '소'}, {0x03, '속'}, {0x04, '솎'}, {0x05, '손'}, {0x06, '솔'}, {0x07, '솖'}, {0x08, '솜'}, {0x09, '솝'}, {0x0A, '솟'}, {0x0B, '송'}, {0x0C, '솥'}, {0x0D, '솨'}, {0x0E, '솩'}, {0x0F, '솬'},
{0x10, '솰'}, {0x11, '솽'}, {0x12, '쇄'}, {0x13, '쇈'}, {0x14, '쇌'}, {0x15, '쇔'}, {0x16, '쇗'}, {0x17, '쇘'}, {0x18, '쇠'}, {0x19, '쇤'}, {0x1A, '쇨'}, {0x1B, '쇰'}, {0x1C, '쇱'}, {0x1D, '쇳'}, {0x1E, '쇼'}, {0x1F, '쇽'},
{0x20, '숀'}, {0x21, '숄'}, {0x22, '숌'}, {0x23, '숍'}, {0x24, '숏'}, {0x25, '숑'}, {0x26, '수'}, {0x27, '숙'}, {0x28, '순'}, {0x29, '숟'}, {0x2A, '술'}, {0x2B, '숨'}, {0x2C, '숩'}, {0x2D, '숫'}, {0x2E, '숭'}, {0x2F, '쌰'},
{0x30, '쎼'}, {0x31, '숯'}, {0x32, '숱'}, {0x33, '숲'}, {0x34, '숴'}, {0x35, '쉈'}, {0x36, '쉐'}, {0x37, '쉑'}, {0x38, '쉔'}, {0x39, '쉘'}, {0x3A, '쉠'}, {0x3B, '쉥'}, {0x3C, '쉬'}, {0x3D, '쉭'}, {0x3E, '쉰'}, {0x3F, '쉴'},
{0x40, '쉼'}, {0x41, '쉽'}, {0x42, '쉿'}, {0x43, '슁'}, {0x44, '슈'}, {0x45, '슉'}, {0x46, '슐'}, {0x47, '슘'}, {0x48, '슛'}, {0x49, '슝'}, {0x4A, '스'}, {0x4B, '슥'}, {0x4C, '슨'}, {0x4D, '슬'}, {0x4E, '슭'}, {0x4F, '슴'},
{0x60, '습'}, {0x61, '슷'}, {0x62, '승'}, {0x63, '시'}, {0x64, '식'}, {0x65, '신'}, {0x66, '싣'}, {0x67, '실'}, {0x68, '싫'}, {0x69, '심'}, {0x6A, '십'}, {0x6B, '싯'}, {0x6C, '싱'}, {0x6D, '싶'}, {0x6E, '싸'}, {0x6F, '싹'},
{0x70, '싻'}, {0x71, '싼'}, {0x72, '쌀'}, {0x73, '쌈'}, {0x74, '쌉'}, {0x75, '쌌'}, {0x76, '쌍'}, {0x77, '쌓'}, {0x78, '쌔'}, {0x79, '쌕'}, {0x7A, '쌘'}, {0x7B, '쌜'}, {0x7C, '쌤'}, {0x7D, '쌥'}, {0x7E, '쌨'}, {0x7F, '쌩'},
{0x80, '썅'}, {0x81, '써'}, {0x82, '썩'}, {0x83, '썬'}, {0x84, '썰'}, {0x85, '썲'}, {0x86, '썸'}, {0x87, '썹'}, {0x88, '썼'}, {0x89, '썽'}, {0x8A, '쎄'}, {0x8B, '쎈'}, {0x8C, '쎌'}, {0x8D, '쏀'}, {0x8E, '쏘'}, {0x8F, '쏙'},
{0x90, '쏜'}, {0x91, '쏟'}, {0x92, '쏠'}, {0x93, '쏢'}, {0x94, '쏨'}, {0x95, '쏩'}, {0x96, '쏭'}, {0x97, '쏴'}, {0x98, '쏵'}, {0x99, '쏸'}, {0x9A, '쐈'}, {0x9B, '쐐'}, {0x9C, '쐤'}, {0x9D, '쐬'}, {0x9E, '쐰'},
{0xA0, '쓔'}, {0xA1, '쐴'}, {0xA2, '쐼'}, {0xA3, '쐽'}, {0xA4, '쑈'}, {0xA5, '쑤'}, {0xA6, '쑥'}, {0xA7, '쑨'}, {0xA8, '쑬'}, {0xA9, '쑴'}, {0xAA, '쑵'}, {0xAB, '쑹'}, {0xAC, '쒀'}, {0xAD, '쒔'}, {0xAE, '쒜'}, {0xAF, '쒸'},
{0xB0, '쒼'}, {0xB1, '쓩'}, {0xB2, '쓰'}, {0xB3, '쓱'}, {0xB4, '쓴'}, {0xB5, '쓸'}, {0xB6, '쓺'}, {0xB7, '쓿'}, {0xB8, '씀'}, {0xB9, '씁'}, {0xBA, '씌'}, {0xBB, '씐'}, {0xBC, '씔'}, {0xBD, '씜'}, {0xBE, '씨'}, {0xBF, '씩'},
{0xC0, '씬'}, {0xC1, '씰'}, {0xC2, '씸'}, {0xC3, '씹'}, {0xC4, '씻'}, {0xC5, '씽'}, {0xC6, '아'}, {0xC7, '악'}, {0xC8, '안'}, {0xC9, '앉'}, {0xCA, '않'}, {0xCB, '알'}, {0xCC, '앍'}, {0xCD, '앎'}, {0xCE, '앓'}, {0xCF, '암'},
{0xD0, '압'}, {0xD1, '앗'}, {0xD2, '았'}, {0xD3, '앙'}, {0xD4, '앝'}, {0xD5, '앞'}, {0xD6, '애'}, {0xD7, '액'}, {0xD8, '앤'}, {0xD9, '앨'}, {0xDA, '앰'}, {0xDB, '앱'}, {0xDC, '앳'}, {0xDD, '앴'}, {0xDE, '앵'}, {0xDF, '야'},
{0xE0, '약'}, {0xE1, '얀'}, {0xE2, '얄'}, {0xE3, '얇'}, {0xE4, '얌'}, {0xE5, '얍'}, {0xE6, '얏'}, {0xE7, '양'}, {0xE8, '얕'}, {0xE9, '얗'}, {0xEA, '얘'}, {0xEB, '얜'}, {0xEC, '얠'}, {0xED, '얩'}, {0xEE, '어'}, {0xEF, '억'},
{0xF0, '언'}, {0xF1, '얹'}, {0xF2, '얻'}, {0xF3, '얼'}, {0xF4, '얽'}, {0xF5, '얾'}, {0xF6, '엄'}, {0xF7, '업'}, {0xF8, '없'}, {0xF9, '엇'}, {0xFA, '었'}, {0xFB, '엉'}, {0xFC, '엊'}, {0xFD, '엌'}, {0xFE, '엎'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_7 = new(256)
{
{0x01, '에'}, {0x02, '엑'}, {0x03, '엔'}, {0x04, '엘'}, {0x05, '엠'}, {0x06, '엡'}, {0x07, '엣'}, {0x08, '엥'}, {0x09, '여'}, {0x0A, '역'}, {0x0B, '엮'}, {0x0C, '연'}, {0x0D, '열'}, {0x0E, '엶'}, {0x0F, '엷'},
{0x10, '염'}, {0x11, '엽'}, {0x12, '엾'}, {0x13, '엿'}, {0x14, '였'}, {0x15, '영'}, {0x16, '옅'}, {0x17, '옆'}, {0x18, '옇'}, {0x19, '예'}, {0x1A, '옌'}, {0x1B, '옐'}, {0x1C, '옘'}, {0x1D, '옙'}, {0x1E, '옛'}, {0x1F, '옜'},
{0x20, '오'}, {0x21, '옥'}, {0x22, '온'}, {0x23, '올'}, {0x24, '옭'}, {0x25, '옮'}, {0x26, '옰'}, {0x27, '옳'}, {0x28, '옴'}, {0x29, '옵'}, {0x2A, '옷'}, {0x2B, '옹'}, {0x2C, '옻'}, {0x2D, '와'}, {0x2E, '왁'}, {0x2F, '완'},
{0x30, '왈'}, {0x31, '왐'}, {0x32, '왑'}, {0x33, '왓'}, {0x34, '왔'}, {0x35, '왕'}, {0x36, '왜'}, {0x37, '왝'}, {0x38, '왠'}, {0x39, '왬'}, {0x3A, '왯'}, {0x3B, '왱'}, {0x3C, '외'}, {0x3D, '왹'}, {0x3E, '왼'}, {0x3F, '욀'},
{0x40, '욈'}, {0x41, '욉'}, {0x42, '욋'}, {0x43, '욍'}, {0x44, '요'}, {0x45, '욕'}, {0x46, '욘'}, {0x47, '욜'}, {0x48, '욤'}, {0x49, '욥'}, {0x4A, '욧'}, {0x4B, '용'}, {0x4C, '우'}, {0x4D, '욱'}, {0x4E, '운'}, {0x4F, '울'},
{0x60, '욹'}, {0x61, '욺'}, {0x62, '움'}, {0x63, '웁'}, {0x64, '웃'}, {0x65, '웅'}, {0x66, '워'}, {0x67, '웍'}, {0x68, '원'}, {0x69, '월'}, {0x6A, '웜'}, {0x6B, '웝'}, {0x6C, '웠'}, {0x6D, '웡'}, {0x6E, '웨'},
{0x71, '웩'}, {0x72, '웬'}, {0x73, '웰'}, {0x74, '웸'}, {0x75, '웹'}, {0x76, '웽'}, {0x77, '위'}, {0x78, '윅'}, {0x79, '윈'}, {0x7A, '윌'}, {0x7B, '윔'}, {0x7C, '윕'}, {0x7D, '윗'}, {0x7E, '윙'}, {0x7F, '유'},
{0x80, '육'}, {0x81, '윤'}, {0x82, '율'}, {0x83, '윰'}, {0x84, '윱'}, {0x85, '윳'}, {0x86, '융'}, {0x87, '윷'}, {0x88, '으'}, {0x89, '윽'}, {0x8A, '은'}, {0x8B, '을'}, {0x8C, '읆'}, {0x8D, '음'}, {0x8E, '읍'}, {0x8F, '읏'},
{0x90, '응'}, {0x91, '읒'}, {0x92, '읓'}, {0x93, '읔'}, {0x94, '읕'}, {0x95, '읖'}, {0x96, '읗'}, {0x97, '의'}, {0x98, '읜'}, {0x99, '읠'}, {0x9A, '읨'}, {0x9B, '읫'}, {0x9C, '이'}, {0x9D, '익'}, {0x9E, '인'}, {0x9F, '일'},
{0xA0, '읽'}, {0xA1, '읾'}, {0xA2, '잃'}, {0xA3, '임'}, {0xA4, '입'}, {0xA5, '잇'}, {0xA6, '있'}, {0xA7, '잉'}, {0xA8, '잊'}, {0xA9, '잎'}, {0xAA, '자'}, {0xAB, '작'}, {0xAC, '잔'}, {0xAD, '잖'}, {0xAE, '잗'}, {0xAF, '잘'},
{0xB0, '잚'}, {0xB1, '잠'}, {0xB2, '잡'}, {0xB3, '잣'}, {0xB4, '잤'}, {0xB5, '장'}, {0xB6, '잦'}, {0xB7, '재'}, {0xB8, '잭'}, {0xB9, '잰'}, {0xBA, '잴'}, {0xBB, '잼'}, {0xBC, '잽'}, {0xBD, '잿'}, {0xBE, '쟀'}, {0xBF, '쟁'},
{0xC0, '쟈'}, {0xC1, '쟉'}, {0xC2, '쟌'}, {0xC3, '쟎'}, {0xC4, '쟐'}, {0xC5, '쟘'}, {0xC6, '쟝'}, {0xC7, '쟤'}, {0xC8, '쟨'}, {0xC9, '쟬'}, {0xCA, '저'}, {0xCB, '적'}, {0xCC, '전'}, {0xCD, '절'}, {0xCE, '젊'},
{0xD1, '점'}, {0xD2, '접'}, {0xD3, '젓'}, {0xD4, '정'}, {0xD5, '젖'}, {0xD6, '제'}, {0xD7, '젝'}, {0xD8, '젠'}, {0xD9, '젤'}, {0xDA, '젬'}, {0xDB, '젭'}, {0xDC, '젯'}, {0xDD, '젱'}, {0xDE, '져'}, {0xDF, '젼'},
{0xE0, '졀'}, {0xE1, '졈'}, {0xE2, '졉'}, {0xE3, '졌'}, {0xE4, '졍'}, {0xE5, '졔'}, {0xE6, '조'}, {0xE7, '족'}, {0xE8, '존'}, {0xE9, '졸'}, {0xEA, '졺'}, {0xEB, '좀'}, {0xEC, '좁'}, {0xED, '좃'}, {0xEE, '종'}, {0xEF, '좆'},
{0xF0, '좇'}, {0xF1, '좋'}, {0xF2, '좌'}, {0xF3, '좍'}, {0xF4, '좔'}, {0xF5, '좝'}, {0xF6, '좟'}, {0xF7, '좡'}, {0xF8, '좨'}, {0xF9, '좼'}, {0xFA, '좽'}, {0xFB, '죄'}, {0xFC, '죈'}, {0xFD, '죌'}, {0xFE, '죔'}, {0xFF, '죕'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_8 = new(256)
{
{0x00, '죗'}, {0x01, '죙'}, {0x02, '죠'}, {0x03, '죡'}, {0x04, '죤'}, {0x05, '죵'}, {0x06, '주'}, {0x07, '죽'}, {0x08, '준'}, {0x09, '줄'}, {0x0A, '줅'}, {0x0B, '줆'}, {0x0C, '줌'}, {0x0D, '줍'}, {0x0E, '줏'}, {0x0F, '중'},
{0x10, '줘'}, {0x11, '줬'}, {0x12, '줴'}, {0x13, '쥐'}, {0x14, '쥑'}, {0x15, '쥔'}, {0x16, '쥘'}, {0x17, '쥠'}, {0x18, '쥡'}, {0x19, '쥣'}, {0x1A, '쥬'}, {0x1B, '쥰'}, {0x1C, '쥴'}, {0x1D, '쥼'}, {0x1E, '즈'}, {0x1F, '즉'},
{0x20, '즌'}, {0x21, '즐'}, {0x22, '즘'}, {0x23, '즙'}, {0x24, '즛'}, {0x25, '증'}, {0x26, '지'}, {0x27, '직'}, {0x28, '진'}, {0x29, '짇'}, {0x2A, '질'}, {0x2B, '짊'}, {0x2C, '짐'}, {0x2D, '집'}, {0x2E, '짓'},
{0x30, '쬬'}, {0x31, '징'}, {0x32, '짖'}, {0x33, '짙'}, {0x34, '짚'}, {0x35, '짜'}, {0x36, '짝'}, {0x37, '짠'}, {0x38, '짢'}, {0x39, '짤'}, {0x3A, '짧'}, {0x3B, '짬'}, {0x3C, '짭'}, {0x3D, '짯'}, {0x3E, '짰'}, {0x3F, '짱'},
{0x40, '째'}, {0x41, '짹'}, {0x42, '짼'}, {0x43, '쨀'}, {0x44, '쨈'}, {0x45, '쨉'}, {0x46, '쨋'}, {0x47, '쨌'}, {0x48, '쨍'}, {0x49, '쨔'}, {0x4A, '쨘'}, {0x4B, '쨩'}, {0x4C, '쩌'}, {0x4D, '쩍'}, {0x4E, '쩐'}, {0x4F, '쩔'},
{0x60, '쩜'}, {0x61, '쩝'}, {0x62, '쩟'}, {0x63, '쩠'}, {0x64, '쩡'}, {0x65, '쩨'}, {0x66, '쩽'}, {0x67, '쪄'}, {0x68, '쪘'}, {0x69, '쪼'}, {0x6A, '쪽'}, {0x6B, '쫀'}, {0x6C, '쫄'}, {0x6D, '쫌'}, {0x6E, '쫍'}, {0x6F, '쫏'},
{0x70, '쫑'}, {0x71, '쫓'}, {0x72, '쫘'}, {0x73, '쫙'}, {0x74, '쫠'}, {0x75, '쫬'}, {0x76, '쫴'}, {0x77, '쬈'}, {0x78, '쬐'}, {0x79, '쬔'}, {0x7A, '쬘'}, {0x7B, '쬠'}, {0x7C, '쬡'}, {0x7D, '쭁'}, {0x7E, '쭈'}, {0x7F, '쭉'},
{0x80, '쭌'}, {0x81, '쭐'}, {0x82, '쭘'}, {0x83, '쭙'}, {0x84, '쭝'}, {0x85, '쭤'}, {0x86, '쭸'}, {0x87, '쭹'}, {0x88, '쮜'}, {0x89, '쮸'}, {0x8A, '쯔'}, {0x8B, '쯤'}, {0x8C, '쯧'}, {0x8D, '쯩'}, {0x8E, '찌'}, {0x8F, '찍'},
{0x90, '찐'}, {0x91, '찔'}, {0x92, '찜'}, {0x93, '찝'}, {0x94, '찡'}, {0x95, '찢'}, {0x96, '찧'}, {0x97, '차'}, {0x98, '착'}, {0x99, '찬'}, {0x9A, '찮'}, {0x9B, '찰'}, {0x9C, '참'}, {0x9D, '찹'}, {0x9E, '찻'},
{0xA1, '찼'}, {0xA2, '창'}, {0xA3, '찾'}, {0xA4, '채'}, {0xA5, '책'}, {0xA6, '챈'}, {0xA7, '챌'}, {0xA8, '챔'}, {0xA9, '챕'}, {0xAA, '챗'}, {0xAB, '챘'}, {0xAC, '챙'}, {0xAD, '챠'}, {0xAE, '챤'}, {0xAF, '챦'},
{0xB0, '챨'}, {0xB1, '챰'}, {0xB2, '챵'}, {0xB3, '처'}, {0xB4, '척'}, {0xB5, '천'}, {0xB6, '철'}, {0xB7, '첨'}, {0xB8, '첩'}, {0xB9, '첫'}, {0xBA, '첬'}, {0xBB, '청'}, {0xBC, '체'}, {0xBD, '첵'}, {0xBE, '첸'}, {0xBF, '첼'},
{0xC0, '쳄'}, {0xC1, '쳅'}, {0xC2, '쳇'}, {0xC3, '쳉'}, {0xC4, '쳐'}, {0xC5, '쳔'}, {0xC6, '쳤'}, {0xC7, '쳬'}, {0xC8, '쳰'}, {0xC9, '촁'}, {0xCA, '초'}, {0xCB, '촉'}, {0xCC, '촌'}, {0xCD, '촐'}, {0xCE, '촘'}, {0xCF, '촙'},
{0xD0, '촛'}, {0xD1, '총'}, {0xD2, '촤'}, {0xD3, '촨'}, {0xD4, '촬'}, {0xD5, '촹'}, {0xD6, '최'}, {0xD7, '쵠'}, {0xD8, '쵤'}, {0xD9, '쵬'}, {0xDA, '쵭'}, {0xDB, '쵯'}, {0xDC, '쵱'}, {0xDD, '쵸'}, {0xDE, '춈'}, {0xDF, '추'},
{0xE0, '축'}, {0xE1, '춘'}, {0xE2, '출'}, {0xE3, '춤'}, {0xE4, '춥'}, {0xE5, '춧'}, {0xE6, '충'}, {0xE7, '춰'}, {0xE8, '췄'}, {0xE9, '췌'}, {0xEA, '췐'}, {0xEB, '취'}, {0xEC, '췬'}, {0xED, '췰'}, {0xEE, '췸'}, {0xEF, '췹'},
{0xF0, '췻'}, {0xF1, '췽'}, {0xF2, '츄'}, {0xF3, '츈'}, {0xF4, '츌'}, {0xF5, '츔'}, {0xF6, '츙'}, {0xF7, '츠'}, {0xF8, '측'}, {0xF9, '츤'}, {0xFA, '츨'}, {0xFB, '츰'}, {0xFC, '츱'}, {0xFD, '츳'}, {0xFE, '층'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_9 = new(256)
{
{0x01, '치'}, {0x02, '칙'}, {0x03, '친'}, {0x04, '칟'}, {0x05, '칠'}, {0x06, '칡'}, {0x07, '침'}, {0x08, '칩'}, {0x09, '칫'}, {0x0A, '칭'}, {0x0B, '카'}, {0x0C, '칵'}, {0x0D, '칸'}, {0x0E, '칼'}, {0x0F, '캄'},
{0x10, '캅'}, {0x11, '캇'}, {0x12, '캉'}, {0x13, '캐'}, {0x14, '캑'}, {0x15, '캔'}, {0x16, '캘'}, {0x17, '캠'}, {0x18, '캡'}, {0x19, '캣'}, {0x1A, '캤'}, {0x1B, '캥'}, {0x1C, '캬'}, {0x1D, '캭'}, {0x1E, '컁'}, {0x1F, '커'},
{0x20, '컥'}, {0x21, '컨'}, {0x22, '컫'}, {0x23, '컬'}, {0x24, '컴'}, {0x25, '컵'}, {0x26, '컷'}, {0x27, '컸'}, {0x28, '컹'}, {0x29, '케'}, {0x2A, '켁'}, {0x2B, '켄'}, {0x2C, '켈'}, {0x2D, '켐'}, {0x2E, '켑'}, {0x2F, '켓'},
{0x30, '켕'}, {0x31, '켜'}, {0x32, '켠'}, {0x33, '켤'}, {0x34, '켬'}, {0x35, '켭'}, {0x36, '켯'}, {0x37, '켰'}, {0x38, '켱'}, {0x39, '켸'}, {0x3A, '코'}, {0x3B, '콕'}, {0x3C, '콘'}, {0x3D, '콜'}, {0x3E, '콤'}, {0x3F, '콥'},
{0x40, '콧'}, {0x41, '콩'}, {0x42, '콰'}, {0x43, '콱'}, {0x44, '콴'}, {0x45, '콸'}, {0x46, '쾀'}, {0x47, '쾅'}, {0x48, '쾌'}, {0x49, '쾡'}, {0x4A, '쾨'}, {0x4B, '쾰'}, {0x4C, '쿄'}, {0x4D, '쿠'}, {0x4E, '쿡'}, {0x4F, '쿤'},
{0x60, '쿨'}, {0x61, '쿰'}, {0x62, '쿱'}, {0x63, '쿳'}, {0x64, '쿵'}, {0x65, '쿼'}, {0x66, '퀀'}, {0x67, '퀄'}, {0x68, '퀑'}, {0x69, '퀘'}, {0x6A, '퀭'}, {0x6B, '퀴'}, {0x6C, '퀵'}, {0x6D, '퀸'}, {0x6E, '퀼'},
{0x71, '큄'}, {0x72, '큅'}, {0x73, '큇'}, {0x74, '큉'}, {0x75, '큐'}, {0x76, '큔'}, {0x77, '큘'}, {0x78, '큠'}, {0x79, '크'}, {0x7A, '큭'}, {0x7B, '큰'}, {0x7C, '클'}, {0x7D, '큼'}, {0x7E, '큽'}, {0x7F, '킁'},
{0x80, '키'}, {0x81, '킥'}, {0x82, '킨'}, {0x83, '킬'}, {0x84, '킴'}, {0x85, '킵'}, {0x86, '킷'}, {0x87, '킹'}, {0x88, '타'}, {0x89, '탁'}, {0x8A, '탄'}, {0x8B, '탈'}, {0x8C, '탉'}, {0x8D, '탐'}, {0x8E, '탑'}, {0x8F, '탓'},
{0x90, '탔'}, {0x91, '탕'}, {0x92, '태'}, {0x93, '택'}, {0x94, '탠'}, {0x95, '탤'}, {0x96, '탬'}, {0x97, '탭'}, {0x98, '탯'}, {0x99, '탰'}, {0x9A, '탱'}, {0x9B, '탸'}, {0x9C, '턍'}, {0x9D, '터'}, {0x9E, '턱'}, {0x9F, '턴'},
{0xA0, '털'}, {0xA1, '턺'}, {0xA2, '텀'}, {0xA3, '텁'}, {0xA4, '텃'}, {0xA5, '텄'}, {0xA6, '텅'}, {0xA7, '테'}, {0xA8, '텍'}, {0xA9, '텐'}, {0xAA, '텔'}, {0xAB, '템'}, {0xAC, '텝'}, {0xAD, '텟'}, {0xAE, '텡'}, {0xAF, '텨'},
{0xB0, '텬'}, {0xB1, '텼'}, {0xB2, '톄'}, {0xB3, '톈'}, {0xB4, '토'}, {0xB5, '톡'}, {0xB6, '톤'}, {0xB7, '톨'}, {0xB8, '톰'}, {0xB9, '톱'}, {0xBA, '톳'}, {0xBB, '통'}, {0xBC, '톺'}, {0xBD, '톼'}, {0xBE, '퇀'}, {0xBF, '퇘'},
{0xC0, '퇴'}, {0xC1, '퇸'}, {0xC2, '툇'}, {0xC3, '툉'}, {0xC4, '툐'}, {0xC5, '투'}, {0xC6, '툭'}, {0xC7, '툰'}, {0xC8, '툴'}, {0xC9, '툼'}, {0xCA, '툽'}, {0xCB, '툿'}, {0xCC, '퉁'}, {0xCD, '퉈'}, {0xCE, '퉜'},
{0xD1, '퉤'}, {0xD2, '튀'}, {0xD3, '튁'}, {0xD4, '튄'}, {0xD5, '튈'}, {0xD6, '튐'}, {0xD7, '튑'}, {0xD8, '튕'}, {0xD9, '튜'}, {0xDA, '튠'}, {0xDB, '튤'}, {0xDC, '튬'}, {0xDD, '튱'}, {0xDE, '트'}, {0xDF, '특'},
{0xE0, '튼'}, {0xE1, '튿'}, {0xE2, '틀'}, {0xE3, '틂'}, {0xE4, '틈'}, {0xE5, '틉'}, {0xE6, '틋'}, {0xE7, '틔'}, {0xE8, '틘'}, {0xE9, '틜'}, {0xEA, '틤'}, {0xEB, '틥'}, {0xEC, '티'}, {0xED, '틱'}, {0xEE, '틴'}, {0xEF, '틸'},
{0xF0, '팀'}, {0xF1, '팁'}, {0xF2, '팃'}, {0xF3, '팅'}, {0xF4, '파'}, {0xF5, '팍'}, {0xF6, '팎'}, {0xF7, '판'}, {0xF8, '팔'}, {0xF9, '팖'}, {0xFA, '팜'}, {0xFB, '팝'}, {0xFC, '팟'}, {0xFD, '팠'}, {0xFE, '팡'}, {0xFF, '팥'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_A = new(256)
{
{0x00, '패'}, {0x01, '팩'}, {0x02, '팬'}, {0x03, '팰'}, {0x04, '팸'}, {0x05, '팹'}, {0x06, '팻'}, {0x07, '팼'}, {0x08, '팽'}, {0x09, '퍄'}, {0x0A, '퍅'}, {0x0B, '퍼'}, {0x0C, '퍽'}, {0x0D, '펀'}, {0x0E, '펄'}, {0x0F, '펌'},
{0x10, '펍'}, {0x11, '펏'}, {0x12, '펐'}, {0x13, '펑'}, {0x14, '페'}, {0x15, '펙'}, {0x16, '펜'}, {0x17, '펠'}, {0x18, '펨'}, {0x19, '펩'}, {0x1A, '펫'}, {0x1B, '펭'}, {0x1C, '펴'}, {0x1D, '편'}, {0x1E, '펼'}, {0x1F, '폄'},
{0x20, '폅'}, {0x21, '폈'}, {0x22, '평'}, {0x23, '폐'}, {0x24, '폘'}, {0x25, '폡'}, {0x26, '폣'}, {0x27, '포'}, {0x28, '폭'}, {0x29, '폰'}, {0x2A, '폴'}, {0x2B, '폼'}, {0x2C, '폽'}, {0x2D, '폿'}, {0x2E, '퐁'},
{0x31, '퐈'}, {0x32, '퐝'}, {0x33, '푀'}, {0x34, '푄'}, {0x35, '표'}, {0x36, '푠'}, {0x37, '푤'}, {0x38, '푭'}, {0x39, '푯'}, {0x3A, '푸'}, {0x3B, '푹'}, {0x3C, '푼'}, {0x3D, '푿'}, {0x3E, '풀'}, {0x3F, '풂'},
{0x40, '품'}, {0x41, '풉'}, {0x42, '풋'}, {0x43, '풍'}, {0x44, '풔'}, {0x45, '풩'}, {0x46, '퓌'}, {0x47, '퓐'}, {0x48, '퓔'}, {0x49, '퓜'}, {0x4A, '퓟'}, {0x4B, '퓨'}, {0x4C, '퓬'}, {0x4D, '퓰'}, {0x4E, '퓸'}, {0x4F, '퓻'},
{0x60, '퓽'}, {0x61, '프'}, {0x62, '픈'}, {0x63, '플'}, {0x64, '픔'}, {0x65, '픕'}, {0x66, '픗'}, {0x67, '피'}, {0x68, '픽'}, {0x69, '핀'}, {0x6A, '필'}, {0x6B, '핌'}, {0x6C, '핍'}, {0x6D, '핏'}, {0x6E, '핑'}, {0x6F, '하'},
{0x70, '학'}, {0x71, '한'}, {0x72, '할'}, {0x73, '핥'}, {0x74, '함'}, {0x75, '합'}, {0x76, '핫'}, {0x77, '항'}, {0x78, '해'}, {0x79, '핵'}, {0x7A, '핸'}, {0x7B, '핼'}, {0x7C, '햄'}, {0x7D, '햅'}, {0x7E, '햇'}, {0x7F, '했'},
{0x80, '행'}, {0x81, '햐'}, {0x82, '향'}, {0x83, '허'}, {0x84, '헉'}, {0x85, '헌'}, {0x86, '헐'}, {0x87, '헒'}, {0x88, '험'}, {0x89, '헙'}, {0x8A, '헛'}, {0x8B, '헝'}, {0x8C, '헤'}, {0x8D, '헥'}, {0x8E, '헨'}, {0x8F, '헬'},
{0x90, '헴'}, {0x91, '헵'}, {0x92, '헷'}, {0x93, '헹'}, {0x94, '혀'}, {0x95, '혁'}, {0x96, '현'}, {0x97, '혈'}, {0x98, '혐'}, {0x99, '협'}, {0x9A, '혓'}, {0x9B, '혔'}, {0x9C, '형'}, {0x9D, '혜'}, {0x9E, '혠'},
{0xA1, '혤'}, {0xA2, '혭'}, {0xA3, '호'}, {0xA4, '혹'}, {0xA5, '혼'}, {0xA6, '홀'}, {0xA7, '홅'}, {0xA8, '홈'}, {0xA9, '홉'}, {0xAA, '홋'}, {0xAB, '홍'}, {0xAC, '홑'}, {0xAD, '화'}, {0xAE, '확'}, {0xAF, '환'},
{0xB0, '활'}, {0xB1, '홧'}, {0xB2, '황'}, {0xB3, '홰'}, {0xB4, '홱'}, {0xB5, '홴'}, {0xB6, '횃'}, {0xB7, '횅'}, {0xB8, '회'}, {0xB9, '획'}, {0xBA, '횐'}, {0xBB, '횔'}, {0xBC, '횝'}, {0xBD, '횟'}, {0xBE, '횡'}, {0xBF, '효'},
{0xC0, '횬'}, {0xC1, '횰'}, {0xC2, '횹'}, {0xC3, '횻'}, {0xC4, '후'}, {0xC5, '훅'}, {0xC6, '훈'}, {0xC7, '훌'}, {0xC8, '훑'}, {0xC9, '훔'}, {0xCA, '훗'}, {0xCB, '훙'}, {0xCC, '훠'}, {0xCD, '훤'}, {0xCE, '훨'}, {0xCF, '훰'},
{0xD0, '훵'}, {0xD1, '훼'}, {0xD2, '훽'}, {0xD3, '휀'}, {0xD4, '휄'}, {0xD5, '휑'}, {0xD6, '휘'}, {0xD7, '휙'}, {0xD8, '휜'}, {0xD9, '휠'}, {0xDA, '휨'}, {0xDB, '휩'}, {0xDC, '휫'}, {0xDD, '휭'}, {0xDE, '휴'}, {0xDF, '휵'},
{0xE0, '휸'}, {0xE1, '휼'}, {0xE2, '흄'}, {0xE3, '흇'}, {0xE4, '흉'}, {0xE5, '흐'}, {0xE6, '흑'}, {0xE7, '흔'}, {0xE8, '흖'}, {0xE9, '흗'}, {0xEA, '흘'}, {0xEB, '흙'}, {0xEC, '흠'}, {0xED, '흡'}, {0xEE, '흣'}, {0xEF, '흥'},
{0xF0, '흩'}, {0xF1, '희'}, {0xF2, '흰'}, {0xF3, '흴'}, {0xF4, '흼'}, {0xF5, '흽'}, {0xF6, '힁'}, {0xF7, '히'}, {0xF8, '힉'}, {0xF9, '힌'}, {0xFA, '힐'}, {0xFB, '힘'}, {0xFC, '힙'}, {0xFD, '힛'}, {0xFE, '힝'},
};
private static readonly Dictionary<byte, char> GSC2U_KOR_B = GSC2U_KOR_0;
/// <summary> Unicode codepoint => Gen2 value dictionary pages. </summary>
private static readonly Dictionary<char, byte>[] U2GSC_KOR =
{
U2GSC_KOR_0, U2GSC_KOR_1, U2GSC_KOR_2, U2GSC_KOR_3,
U2GSC_KOR_4, U2GSC_KOR_5, U2GSC_KOR_6, U2GSC_KOR_7,
U2GSC_KOR_8, U2GSC_KOR_9, U2GSC_KOR_A, U2GSC_KOR_B,
};
/// <summary> Gen2 value => Unicode codepoint dictionary pages. </summary>
private static readonly Dictionary<byte, char>[] GSC2U_KOR =
{
GSC2U_KOR_0, GSC2U_KOR_1, GSC2U_KOR_2, GSC2U_KOR_3,
GSC2U_KOR_4, GSC2U_KOR_5, GSC2U_KOR_6, GSC2U_KOR_7,
GSC2U_KOR_8, GSC2U_KOR_9, GSC2U_KOR_A, GSC2U_KOR_B,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, ' ',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', NUL, NUL, NUL, NUL, NUL, NUL,
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL,
NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, '♂',
NUL, '×', NUL, '/', NUL, '♀', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
};
#endregion

View file

@ -1,4 +1,3 @@
using System.Collections.Generic;
using FluentAssertions;
using Xunit;
@ -81,29 +80,21 @@ public class MemeCryptoTests
Assert.True(MemeCrypto.VerifyMemePOKE(vector2, out _));
}
public static IEnumerable<object[]> KnownKeys()
{
yield return new object[] { MemeKeyIndex.LocalWireless, "1010030000030000000A0070300051308B3001FFD43020AB301003B430FC30B90830C830D10007C630A382000D6E300A005F00055700305D3046306A300000307530933044304D28306B000B5500158F308C203066002581305A3089A0002744002344308D30612A304C00276E0031DF0001C30830AD30E500110A0042A0004973003D4D305F308880007B0A006830823060C4002F10516A3063004D42305F5200536D009900A6F002F014F026FFF038F04AF05CF06EF080F092F0A4F0B6FFF0C8F0DAF0ECF0FEF110F122F134F1460000B5E400004646F86000F1AB31AB0030D730EC0E30BC30F3020FF173A723C162C9700608C5DCAFAB898032382AF1FA717BBC5D91C61AD7B6EA356220742C2DD4595765FCD8123D1E10ED6B0A1DA45D0C2148035A560BB1C5C246FA7EB64D729FC1DD8B61B4737DC51E184A97E4795E82BFD045743EC2AEAED26E87".ToByteArray() };
yield return new object[] { MemeKeyIndex.FriendlyCompetition, "0300000077000000000000000D0106060404003204000101000000000000000000000000000000000000C00000000000000000000000000E000000000000000000000000000000C0070000000000000000000000987E000000000000000000000000000000000000D80300000000000000F00300000000000000E001070000000000000000000000000000000000000000000000000000000101920200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E2D0100015A03000000BE0700000000C287010050006F006B00E9006D006F006E00200054007200610069006E006500720020004F006E006C0069006E006500200043006F006D007000650074006900740069006F006E000000000000007700770077002E0070006F006B0065006D006F006E002D0074007200610069007DC67F945B27557C97D6C0B6D20FF11AFCE1580C5E9E80C7C3FBBA53B67F24D1A91BA2FB8CDD31F7FE29D894B3764A45407658BB9A6E6DC8B3F6A45F77686AC56EA64C0298D1B22F3D3850ADE10AEA6E185FD0EEA91AA38E3F0F0AA9E7ADA132".ToByteArray() };
yield return new object[] { MemeKeyIndex.LiveCompetition, "0300000077000000000000000D0006060303003204000101000000000000000000000000000000000000C00000000000000000000000000E000000000000000000000000000000C0070000000000000000000000987E000000000000000000000000000000000000D80300000000000000F00300000000000000E001070000000000000000000000000000000000000000000000000000000101920200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E2D0100015A03000000BE07000000000B9101004900720069007300200043006D007000650074006900740069006F006E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066007200650065000000000000000000000000000000000000000000000000006425CA0A78E79154EBA19550A0734F84A0C49F8B02E51FA8310548FFF14B7338276188C11C85C15701DAED228099FBF95A277E6249625208D8992FF027385D897AC097F0240C93A70E35FB8AD971DFE14832988DC70F5D1BE19C7EF5FBAFCC12".ToByteArray() };
yield return new object[] { MemeKeyIndex.RentalTeam, "0300000077000000B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C74E35E4783A7E9E161C919C0E736F61B31741B8C1873C5D06D1D408D9DA9FE28DCB53851518FCC0758915EE2911B2194B20131C2E87BC63A255F3A5187763FAF99B1B99D0E4460125CCB7F1CE4A3CC0FC64463454DB25CC851EF9A360EA3D4BDB44B8DE96D1C9839744A3BF7A27FDF41A86491666DAA7BEF55EBFB954BA3FF741657252490BD11350EEF367DA0D229E04EE61DCA1220576014AC2E24232337AB4E7ADEE92B59C44E9AB8D19E0BA87547A0351C4088EDF8808D692461C84EB5D07C795D3B037290AC7C5A9FD2775A86EAD628F545F6E5193145ED22B3BCDE16FD3CCEEA80A5FD90CF8FD320C1D064C8881BF369F0D82EE0E637C434EC6CA4221FE0952C28A7E930956DC2B990817BCC2349EC4339CDD09E2ABB94DC44C171A1E70E2CC5538B9686A1E4AFF907436378FE2915F217EC7C3BA69E47C913794FFE8285DD399D3E39154CE51BA0C74663BD685634697D76EAB8890CF77E371BA7E5CD5FA78FAC7D58A3843C993331C8AFC5ABDCD17FC42B7C28A196C2FB0EF03FE84CAF3FD626A584D9406BC6FC5DC20DD0E19D1D08C96D9065F376E052639FFC0F61CCCE84CDC833F31B9A6C830DE9F58B257F5CBE5991FCA51871752B611AE3B21F5E1F1AE3CFAB49BC6F6721C1C18B74B11400D029E268D".ToByteArray() };
yield return new object[] { MemeKeyIndex.PokedexAndSaveFile, "4F3994147824D4F9D9B3EEBDC2DA6777585413FA41D22347A3593E22467E2F117B51EDFEAE5977E19AD88EB1C63ADB7E9DEDB7F5AEEFECA5F777C7F12527729025C82DC4A12C8B344EB472B9F68BFD999916F0D03460FF1D3FDC5EF0F7A7F8FE".ToByteArray() };
yield return new object[] { MemeKeyIndex.GaOle, "7C7F70413806DFD1D4E8F5610BE3CA705245593C24AB3102D7768D43B3D873EEB5BB6B188FD4F38F06EB06C1A27369E9822D10093DAD17692EA2D71BCB8941F883F3F0E2068941F65FB26950B7E54F5990E163809594381C99CF3330F052452C".ToByteArray() };
yield return new object[] { MemeKeyIndex.MagearnaEvent, "9D741CBA2ABA23408461AC168B3227199C15FFA2784662FE169459DDC2409AE08FA302A6E7026051C8378D09898500028021FE21B1A8165C9918779BA140597E03ED3EAF2FD82C026B17E6BB0D1C4BC6CE06E9FAC2E5DCDD4025983DE57C67CA".ToByteArray() };
yield return new object[] { MemeKeyIndex.MoncolleGet, "9914945B3280796FF8EC694681ED2218F8FCD1C6628FCFACD633A86622D278C09FD1BA1B2E60AF2896EDDAF76110CA246AED9E08D7D90F7F285764BBD3E20E05A11BA214C96B1A54E1A8D48DE6EF060C79011A4B3326FBE55F29FDE40B31F470".ToByteArray() };
yield return new object[] { MemeKeyIndex.IslandScanEventSpecial, "34B08442E3D68D3730CF5CEE9E82BCFD5F6664168F43E9F2EA26CC7B94B1F44FF7B3C0BAD5C346693DDAD5461E6087AD061015744F6DBA294F9BCD6F0E7A35859F0A15F358EB00BED5A4C18841A8B6A69D91FC603E6DCE058DD96983C5DFBB04".ToByteArray() };
yield return new object[] { MemeKeyIndex.TvTokyoDataBroadcasting, "195B4EA9F48E6ADBEE73EB0D529C14EDC99BB011F214E0812E5198BE40739783646FB8C75ABFFD84AA11FB095EFFF5E383F7F45A56A96780C79EBABB430D860FA6CB3D0BFC163C52EDC5C199963D3E518758F911569E1C667BF8A15643A19E2F".ToByteArray() };
yield return new object[] { MemeKeyIndex.CapPikachuEvent, "A96E2D8D9B99DBFB934939C097E3AC101C7D48CEC52FCA717B14B19890208592045C430035DD09A31446142E9EA33CF3E6B6E69484B6D2EED500B8389048013491602403DBE7B814EA069667CFADAFE74895217D78037B4A456FAB2CAFD71E69".ToByteArray() };
//yield return new object[] { MemeKeyIndex.Unknown10, null };
//yield return new object[] { MemeKeyIndex.Unknown11, null };
//yield return new object[] { MemeKeyIndex.Unknown12, null };
//yield return new object[] { MemeKeyIndex.Unknown13, null };
}
[Theory]
[MemberData(nameof(KnownKeys))]
public void TestVerifyKnownKeys(MemeKeyIndex keyIndex, byte[] key)
[InlineData(MemeKeyIndex.LocalWireless, "1010030000030000000A0070300051308B3001FFD43020AB301003B430FC30B90830C830D10007C630A382000D6E300A005F00055700305D3046306A300000307530933044304D28306B000B5500158F308C203066002581305A3089A0002744002344308D30612A304C00276E0031DF0001C30830AD30E500110A0042A0004973003D4D305F308880007B0A006830823060C4002F10516A3063004D42305F5200536D009900A6F002F014F026FFF038F04AF05CF06EF080F092F0A4F0B6FFF0C8F0DAF0ECF0FEF110F122F134F1460000B5E400004646F86000F1AB31AB0030D730EC0E30BC30F3020FF173A723C162C9700608C5DCAFAB898032382AF1FA717BBC5D91C61AD7B6EA356220742C2DD4595765FCD8123D1E10ED6B0A1DA45D0C2148035A560BB1C5C246FA7EB64D729FC1DD8B61B4737DC51E184A97E4795E82BFD045743EC2AEAED26E87")]
[InlineData(MemeKeyIndex.FriendlyCompetition, "0300000077000000000000000D0106060404003204000101000000000000000000000000000000000000C00000000000000000000000000E000000000000000000000000000000C0070000000000000000000000987E000000000000000000000000000000000000D80300000000000000F00300000000000000E001070000000000000000000000000000000000000000000000000000000101920200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E2D0100015A03000000BE0700000000C287010050006F006B00E9006D006F006E00200054007200610069006E006500720020004F006E006C0069006E006500200043006F006D007000650074006900740069006F006E000000000000007700770077002E0070006F006B0065006D006F006E002D0074007200610069007DC67F945B27557C97D6C0B6D20FF11AFCE1580C5E9E80C7C3FBBA53B67F24D1A91BA2FB8CDD31F7FE29D894B3764A45407658BB9A6E6DC8B3F6A45F77686AC56EA64C0298D1B22F3D3850ADE10AEA6E185FD0EEA91AA38E3F0F0AA9E7ADA132")]
[InlineData(MemeKeyIndex.LiveCompetition, "0300000077000000000000000D0006060303003204000101000000000000000000000000000000000000C00000000000000000000000000E000000000000000000000000000000C0070000000000000000000000987E000000000000000000000000000000000000D80300000000000000F00300000000000000E001070000000000000000000000000000000000000000000000000000000101920200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E2D0100015A03000000BE07000000000B9101004900720069007300200043006D007000650074006900740069006F006E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066007200650065000000000000000000000000000000000000000000000000006425CA0A78E79154EBA19550A0734F84A0C49F8B02E51FA8310548FFF14B7338276188C11C85C15701DAED228099FBF95A277E6249625208D8992FF027385D897AC097F0240C93A70E35FB8AD971DFE14832988DC70F5D1BE19C7EF5FBAFCC12")]
[InlineData(MemeKeyIndex.RentalTeam, "0300000077000000B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C74E35E4783A7E9E161C919C0E736F61B31741B8C1873C5D06D1D408D9DA9FE28DCB53851518FCC0758915EE2911B2194B20131C2E87BC63A255F3A5187763FAF99B1B99D0E4460125CCB7F1CE4A3CC0FC64463454DB25CC851EF9A360EA3D4BDB44B8DE96D1C9839744A3BF7A27FDF41A86491666DAA7BEF55EBFB954BA3FF741657252490BD11350EEF367DA0D229E04EE61DCA1220576014AC2E24232337AB4E7ADEE92B59C44E9AB8D19E0BA87547A0351C4088EDF8808D692461C84EB5D07C795D3B037290AC7C5A9FD2775A86EAD628F545F6E5193145ED22B3BCDE16FD3CCEEA80A5FD90CF8FD320C1D064C8881BF369F0D82EE0E637C434EC6CA4221FE0952C28A7E930956DC2B990817BCC2349EC4339CDD09E2ABB94DC44C171A1E70E2CC5538B9686A1E4AFF907436378FE2915F217EC7C3BA69E47C913794FFE8285DD399D3E39154CE51BA0C74663BD685634697D76EAB8890CF77E371BA7E5CD5FA78FAC7D58A3843C993331C8AFC5ABDCD17FC42B7C28A196C2FB0EF03FE84CAF3FD626A584D9406BC6FC5DC20DD0E19D1D08C96D9065F376E052639FFC0F61CCCE84CDC833F31B9A6C830DE9F58B257F5CBE5991FCA51871752B611AE3B21F5E1F1AE3CFAB49BC6F6721C1C18B74B11400D029E268D")]
[InlineData(MemeKeyIndex.PokedexAndSaveFile, "4F3994147824D4F9D9B3EEBDC2DA6777585413FA41D22347A3593E22467E2F117B51EDFEAE5977E19AD88EB1C63ADB7E9DEDB7F5AEEFECA5F777C7F12527729025C82DC4A12C8B344EB472B9F68BFD999916F0D03460FF1D3FDC5EF0F7A7F8FE")]
[InlineData(MemeKeyIndex.GaOle, "7C7F70413806DFD1D4E8F5610BE3CA705245593C24AB3102D7768D43B3D873EEB5BB6B188FD4F38F06EB06C1A27369E9822D10093DAD17692EA2D71BCB8941F883F3F0E2068941F65FB26950B7E54F5990E163809594381C99CF3330F052452C")]
[InlineData(MemeKeyIndex.MagearnaEvent, "9D741CBA2ABA23408461AC168B3227199C15FFA2784662FE169459DDC2409AE08FA302A6E7026051C8378D09898500028021FE21B1A8165C9918779BA140597E03ED3EAF2FD82C026B17E6BB0D1C4BC6CE06E9FAC2E5DCDD4025983DE57C67CA")]
[InlineData(MemeKeyIndex.MoncolleGet, "9914945B3280796FF8EC694681ED2218F8FCD1C6628FCFACD633A86622D278C09FD1BA1B2E60AF2896EDDAF76110CA246AED9E08D7D90F7F285764BBD3E20E05A11BA214C96B1A54E1A8D48DE6EF060C79011A4B3326FBE55F29FDE40B31F470")]
[InlineData(MemeKeyIndex.IslandScanEventSpecial, "34B08442E3D68D3730CF5CEE9E82BCFD5F6664168F43E9F2EA26CC7B94B1F44FF7B3C0BAD5C346693DDAD5461E6087AD061015744F6DBA294F9BCD6F0E7A35859F0A15F358EB00BED5A4C18841A8B6A69D91FC603E6DCE058DD96983C5DFBB04")]
[InlineData(MemeKeyIndex.TvTokyoDataBroadcasting, "195B4EA9F48E6ADBEE73EB0D529C14EDC99BB011F214E0812E5198BE40739783646FB8C75ABFFD84AA11FB095EFFF5E383F7F45A56A96780C79EBABB430D860FA6CB3D0BFC163C52EDC5C199963D3E518758F911569E1C667BF8A15643A19E2F")]
[InlineData(MemeKeyIndex.CapPikachuEvent, "A96E2D8D9B99DBFB934939C097E3AC101C7D48CEC52FCA717B14B19890208592045C430035DD09A31446142E9EA33CF3E6B6E69484B6D2EED500B8389048013491602403DBE7B814EA069667CFADAFE74895217D78037B4A456FAB2CAFD71E69")]
public void TestVerifyKnownKeys(MemeKeyIndex keyIndex, string keyVal)
{
var key = keyVal.ToByteArray();
MemeCrypto.VerifyMemeData(key, out _, keyIndex).Should().BeTrue("because the key should be valid");
}
}