Reencode morse.c to UTF-8. This does not make it Unicode aware.

No changes in resulting object file. Moved user-visible symbols into
comment table, so you can see all chars, not just the ones matching your
(fallback) locale.
This commit is contained in:
Ulrich Spörlein 2012-01-15 13:23:01 +00:00
parent 7c6b05d280
commit 260d7b462a

View File

@ -143,26 +143,31 @@ static const struct morsetab mtab[] = {
{'\0', ""}
};
/*
* Code-points for some Latin1 chars in ISO-8859-1 encoding.
* UTF-8 encoded chars in the comments.
*/
static const struct morsetab iso8859_1tab[] = {
{'á', ".--.-"},
{'à', ".--.-"},
{'â', ".--.-"},
{'ä', ".-.-"},
{'ç', "-.-.."},
{'é', "..-.."},
{'è', "..-.."},
{'ê', "-..-."},
{'ö', "---."},
{'ü', "..--"},
{'\340', ".--.-"}, /* à */
{'\341', ".--.-"}, /* á */
{'\342', ".--.-"}, /* â */
{'\344', ".-.-"}, /* ä */
{'\347', "-.-.."}, /* ç */
{'\350', "..-.."}, /* è */
{'\351', "..-.."}, /* é */
{'\352', "-..-."}, /* ê */
{'\366', "---."}, /* ö */
{'\374', "..--"}, /* ü */
{'\0', ""}
};
/*
* Code-points for some Greek chars in ISO-8859-7 encoding.
* UTF-8 encoded chars in the comments.
*/
static const struct morsetab iso8859_7tab[] = {
/*
* The Greek alphabet; you'll need an ISO8859-7 font in order
* to see the actual characters.
* This table does not implement:
* - the special sequences for the seven diphthongs,
* - the punctuation differences.
@ -180,83 +185,83 @@ static const struct morsetab iso8859_7tab[] = {
* ; ..-.-
* ! --..--
*/
{'á', ".-"}, /* alpha */
{'Ü', ".-"}, /* alpha with acute */
{'â', "-..."}, /* beta */
{'ã', "--."}, /* gamma */
{'ä', "-.."}, /* delta */
{'å', "."}, /* epsilon */
{'Ý', "."}, /* epsilon with acute */
{'æ', "--.."}, /* zeta */
{'ç', "...."}, /* eta */
{'Þ', "...."}, /* eta with acute */
{'è', "-.-."}, /* theta */
{'é', ".."}, /* iota */
{'ß', ".."}, /* iota with acute */
{'ú', ".."}, /* iota with diaeresis */
{'À', ".."}, /* iota with acute and diaeresis */
{'ê', "-.-"}, /* kappa */
{'ë', ".-.."}, /* lambda */
{'ì', "--"}, /* mu */
{'í', "-."}, /* nu */
{'î', "-..-"}, /* xi */
{'ï', "---"}, /* omicron */
{'ü', "---"}, /* omicron with acute */
{'ð', ".--."}, /* pi */
{'ñ', ".-."}, /* rho */
{'ó', "..."}, /* sigma */
{'ò', "..."}, /* final sigma */
{'ô', "-"}, /* tau */
{'õ', "-.--"}, /* upsilon */
{'ý', "-.--"}, /* upsilon with acute */
{'û', "-.--"}, /* upsilon and diaeresis */
{'à', "-.--"}, /* upsilon with acute and diaeresis */
{'ö', "..-."}, /* phi */
{'÷', "----"}, /* chi */
{'ø', "--.-"}, /* psi */
{'ù', ".--"}, /* omega */
{'þ', ".--"}, /* omega with acute */
{'\341', ".-"}, /* α, alpha */
{'\334', ".-"}, /* ά, alpha with acute */
{'\342', "-..."}, /* β, beta */
{'\343', "--."}, /* γ, gamma */
{'\344', "-.."}, /* δ, delta */
{'\345', "."}, /* ε, epsilon */
{'\335', "."}, /* έ, epsilon with acute */
{'\346', "--.."}, /* ζ, zeta */
{'\347', "...."}, /* η, eta */
{'\336', "...."}, /* ή, eta with acute */
{'\350', "-.-."}, /* θ, theta */
{'\351', ".."}, /* ι, iota */
{'\337', ".."}, /* ί, iota with acute */
{'\372', ".."}, /* ϊ, iota with diaeresis */
{'\300', ".."}, /* ΐ, iota with acute and diaeresis */
{'\352', "-.-"}, /* κ, kappa */
{'\353', ".-.."}, /* λ, lambda */
{'\354', "--"}, /* μ, mu */
{'\355', "-."}, /* ν, nu */
{'\356', "-..-"}, /* ξ, xi */
{'\357', "---"}, /* ο, omicron */
{'\374', "---"}, /* ό, omicron with acute */
{'\360', ".--."}, /* π, pi */
{'\361', ".-."}, /* ρ, rho */
{'\363', "..."}, /* σ, sigma */
{'\362', "..."}, /* ς, final sigma */
{'\364', "-"}, /* τ, tau */
{'\365', "-.--"}, /* υ, upsilon */
{'\375', "-.--"}, /* ύ, upsilon with acute */
{'\373', "-.--"}, /* ϋ, upsilon and diaeresis */
{'\340', "-.--"}, /* ΰ, upsilon with acute and diaeresis */
{'\366', "..-."}, /* φ, phi */
{'\367', "----"}, /* χ, chi */
{'\370', "--.-"}, /* ψ, psi */
{'\371', ".--"}, /* ω, omega */
{'\376', ".--"}, /* ώ, omega with acute */
{'\0', ""}
};
/*
* Code-points for the Cyrillic alphabet in KOI8-R encoding.
* UTF-8 encoded chars in the comments.
*/
static const struct morsetab koi8rtab[] = {
/*
* The Cyrillic alphabet; you'll need a KOI8-R font in order
* to see the actual characters
*/
{'Á', ".-"}, /* a */
{'Â', "-..."}, /* be */
{'×', ".--"}, /* ve */
{'Ç', "--."}, /* ge */
{'Ä', "-.."}, /* de */
{'Å', "."}, /* ye */
{'£', "."}, /* yo, the same as ye */
{'Ö', "...-"}, /* she */
{'Ú', "--.."}, /* ze */
{'É', ".."}, /* i */
{'Ê', ".---"}, /* i kratkoye */
{'Ë', "-.-"}, /* ka */
{'Ì', ".-.."}, /* el */
{'Í', "--"}, /* em */
{'Î', "-."}, /* en */
{'Ï', "---"}, /* o */
{'Ð', ".--."}, /* pe */
{'Ò', ".-."}, /* er */
{'Ó', "..."}, /* es */
{'Ô', "-"}, /* te */
{'Õ', "..-"}, /* u */
{'Æ', "..-."}, /* ef */
{'È', "...."}, /* kha */
{'Ã', "-.-."}, /* ce */
{'Þ', "---."}, /* che */
{'Û', "----"}, /* sha */
{'Ý', "--.-"}, /* shcha */
{'Ù', "-.--"}, /* yi */
{'Ø', "-..-"}, /* myakhkij znak */
{'Ü', "..-.."}, /* ae */
{'À', "..--"}, /* yu */
{'Ñ', ".-.-"}, /* ya */
{'\301', ".-"}, /* а, a */
{'\302', "-..."}, /* б, be */
{'\327', ".--"}, /* в, ve */
{'\307', "--."}, /* г, ge */
{'\304', "-.."}, /* д, de */
{'\305', "."}, /* е, ye */
{'\243', "."}, /* ё, yo, the same as ye */
{'\326', "...-"}, /* ж, she */
{'\332', "--.."}, /* з, ze */
{'\311', ".."}, /* и, i */
{'\312', ".---"}, /* й, i kratkoye */
{'\313', "-.-"}, /* к, ka */
{'\314', ".-.."}, /* л, el */
{'\315', "--"}, /* м, em */
{'\316', "-."}, /* н, en */
{'\317', "---"}, /* о, o */
{'\320', ".--."}, /* п, pe */
{'\322', ".-."}, /* р, er */
{'\323', "..."}, /* с, es */
{'\324', "-"}, /* т, te */
{'\325', "..-"}, /* у, u */
{'\306', "..-."}, /* ф, ef */
{'\310', "...."}, /* х, kha */
{'\303', "-.-."}, /* ц, ce */
{'\336', "---."}, /* ч, che */
{'\333', "----"}, /* ш, sha */
{'\335', "--.-"}, /* щ, shcha */
{'\331', "-.--"}, /* ы, yi */
{'\330', "-..-"}, /* ь, myakhkij znak */
{'\334', "..-.."}, /* э, ae */
{'\300', "..--"}, /* ю, yu */
{'\321', ".-.-"}, /* я, ya */
{'\0', ""}
};