Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 May 2012 18:34:29 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r235618 - stable/9/games/morse
Message-ID:  <201205181834.q4IIYTeh068642@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Fri May 18 18:34:29 2012
New Revision: 235618
URL: http://svn.freebsd.org/changeset/base/235618

Log:
  MFC r230131:
  
  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.

Modified:
  stable/9/games/morse/morse.c
Directory Properties:
  stable/9/games/morse/   (props changed)

Modified: stable/9/games/morse/morse.c
==============================================================================
--- stable/9/games/morse/morse.c	Fri May 18 18:32:44 2012	(r235617)
+++ stable/9/games/morse/morse.c	Fri May 18 18:34:29 2012	(r235618)
@@ -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_7ta
 	 * ;	..-.-
 	 * !	--..--
 	 */
-	{'', ".-"},	/* 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', ""}
 };



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205181834.q4IIYTeh068642>