TIP: Click on subject to list as thread! ANSI
echo: linux
to: Holger Granholm
from: Maurice Kinal
date: 2019-02-25 22:28:00
subject: Character codes

Hey Holger!

Note that I am replying on a different machine this time since I am in the 
middle of a major overhaul on the raspi3b+ which will take at least another 32 
hours.  The Swedish, Danish, and Spanish MøøSGing configurations are on that 
machine.  This machine is the English jobber.  I also have a Dutch jobber on a 
totally different machine - also a x86_64-pc-linux-gnu host - but I decided to 
reply on this one instead.

 MK>> That translates to the '÷' character in utf8 - usually written
 MK>> as U+00F7 or \u00f7 in bash.

 HG> This is also a new sign for my UTF conversion whatever use I may
 HG> have.

An excellent online source for utf8 characters is http://www.utf8-chartable.de/ 
as they give the 8 bit codes that show up in hex editors to the corresponding 
utf8 characters.  For example U+00F7 will show up as a hex 'c3 b7' pair whereas 
the small slashed 'o' characters in Møøse show up as 'c3 b8' hex pairs.  So 
in bash speak this should produce the utf8 division sign;

-={ ':read !echo -e "\u00f7 \xc3\xb7"' starts }=-
÷ ÷
-={ ':read !echo -e "\u00f7 \xc3\xb7"' ends }=-

Imagine that!!!  It works!!!

Offhand I am thinking it might make the basis for converting utf8 to whatever 8 
bit codepage you are using by just replacing 'c3 b8' combinations with a single 
hex character that represents the divide sign in your codepage of choice.  So 
for CP850 a conversion vector would look something like this; 
's/\xc3\xb7/\xf6/g' which will replace ALL U+00F7 characters with a single f6 
character.  For the Møøse that would be 's/\xc3\xb8/\x9b/g' and then everyone 
will be happy including the Germans.  ;-)

 HG> If I translate that german line to swedish, norwegian or danish

Yes that can definetly screw things up.  I've done it from english to whatever 
and then from whatever back to english and gotten strange results.  Let's try 
it here;

-={ ':read !trans -b -no-ansi -s english -t swedish "A Møøse once bit my 
sister ..."' starts }=-
En möse hade en gång min syster ...
-={ ':read !trans -b -no-ansi -s english -t swedish "A Møøse once bit my 
sister ..."' ends }=-

We're already off to a bad start but let's leave the möse alone for now;

-={ ':read !trans -b -no-ansi -s swedish -t english "En möse hade en 
gång min syster ..."' starts }=-
A muzzle once had my sister ...
-={ ':read !trans -b -no-ansi -s swedish -t english "En möse hade en 
gång min syster ..."' ends }=-

That didn't work out so well but what about this?;

-={ ':read !trans -b -no-ansi -s swedish -t english "En Møøse hade en 
gång min syster ..."' starts }=-
A mousse once had my sister ...
-={ ':read !trans -b -no-ansi -s swedish -t english "En Møøse hade en 
gång min syster ..."' ends }=-

Not much better is it?  Oh well ... despite this I am sticking with the 
Møøse.  If you have a better Swedish translation I would like to see it but 
the Møøse stays, no matter what my sister or anyone else has to say about it.

Life is good,
Maurice

... A Møøse once bit my sister ...
--- GNU bash, version 5.0.2(1)-release (x86_64-pc-linux-gnu)
                                                                                                                            
* Origin: Little Mikey's EuroPoint - Ladysmith BC, Canada (2:280/464.113)

SOURCE: echomail via QWK@dmine.net

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.