Re: Terminal and UTF-8
Re: Terminal and UTF-8
- Subject: Re: Terminal and UTF-8
- From: Max Horn <email@hidden>
- Date: Tue, 26 Mar 2002 12:38:50 +0100
At 12:11 Uhr +0100 26.03.2002, Manfred Lippert wrote:
Hi,
sorry if a little bit off-topic.
I am using UTF-8 as encoding in the Terminal (-> Terminal Preferences).
I am using Mac OS X in german language and german keyboard layout.
The problem: sometimes this works great, but sometimes it is not usable. :-(
Is this a bug in Mac OS X?
Examples:
- If I try to type "german umlauts" (d, v, |) directly in the shell (tcsh
running in terminal), this does NOT work. It gives cryptic characters or
"beeps".
- In the "cat" program, those characters work quite well! I can type them
and when they are repeated by cat, they are displayed properly.
- I wrote a own little program running in Terminal that reads input from
std-input via getchar(). It works perfectly and gets UTF-8 encoded strings.
Output of those UTF-8 encoded strings is also possible. (Same behaviour like
"cat".)
- In the program "mysql" it is NOT possible to write any "strange"
characters, even copy&paste does not work (same behaviour as tcsh). :-(
But if I import UTF-8 encoded strings from a file into a mysql database
table ("load data" sql command) and display the database table entries, they
are displayed properly in the terminal. So for displaying UTF-8 is used, but
I cannot enter any UTF-8 data.
Can anybody tell me why UTF-8 is not working every time in Terminal?
Is there a way to "fix" this?
BTW: I urgently need to enter UTF-8 encoded strings in mysql. Is there a way
other than importing from a file?
It's quite simple, an applicaton has to support UTF8 for this to
work. Most standard unix applications simply don't do this! That is
"works" in cat is only because cat simply echos anything raw to the
terminal, and also takes your raw input.
UTF8 encoding encodes single letters into 1 up to 6 (or was it even
more) bytes. So if enter an umlaut, two bytes are sent. Most
classical Unix application will interpret this as two key strokes,
for two completly different chars than what you typed.
It's much better to use ISO Latin 1 encoding, supported by the
majority of apps, and the semi-standard charachter encoding in
Western Europe.
Max
--
-----------------------------------------------
Max Horn
Software Developer
email: <
mailto:email@hidden>
phone: (+49) 6151-494890
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.