Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

French characters in Terminal UNIX
I was having a problem when I wanted to insert, in MySQL db, any french characters like "Ú" or "├á" for exemple. The terminal was always giving me "??" instead. This was also true when connecting to my Linux/MySQL server using SSH. Keep getting those "??" when doing a SELECT FROM.

Simple fix:
 - Open Terminal app and go in Preferences.
 - In the Shell section, choose "ISO Latin 1" in the String Encoding menu.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[8,228 views]  

French characters in Terminal | 11 comments | Create New Account
Click here to return to the 'French characters in Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
more on this
Authored by: little_dude on Mar 13, '02 03:54:16AM
if you want to insert data from a textfile that was created on a mac with non-unix tools, say with BBEdit or MS Word, you'll find yorself in problems too with the character encodings. You'll have to convert the file from MacOS Roman to ISO Latin1.

I always use cyclone for this, which is a really neat tool, and free (as in speech) !

[ Reply to This | # ]
UTF-8
Authored by: seb2 on Mar 13, '02 04:56:49AM

For German, UTF-8 seems to be the correct encoding.

The question is, however, how do you *type* accented characters or umlauts? I can see my files but I can't access them unless I use tab - kind of annoying.



[ Reply to This | # ]
French characters
Authored by: Ken Knoblauch on Mar 13, '02 11:23:11AM

I have a Ti G4 with a French keyboard. I've tried every encoding under the
Terminal preferences, but when I type any French accented characters on
the keyboard, all I get is an error signal. In vi, I get character codes.
I can name files in the Finder with accented characters but when I do an 'ls'
in terminal, the accented characters become character codes and I haven't
figured out a way to reference them yet. I'm keeping to 7bit ascii names
now, but would like to know how to handle the problem eventually.



[ Reply to This | # ]
French characters
Authored by: see on Mar 13, '02 02:09:22PM

i have this in my .bashrc to get 8bit chars working in terminal...how it's done in tcsh and other shells i have no idea...

stty cs8 -istrip -parenb
bind 'set convert-meta off'
bind 'set meta-flag on'
bind 'set output-meta on'

hope it helps (also have latin-1 as the setting)...this is getting all swedish chars working
vi etc needs to be compiled with support for it to show 8-bit chars instead of the code of the chars



[ Reply to This | # ]
French characters
Authored by: Ken Knoblauch on Mar 16, '02 11:02:52AM

Here is something that might be useful, if someone can suggest how
to apply it more generally. I was looking through my system to see if I had the source for vi to follow-up on the suggestion to recompile it for French characters and I came across the commands vis and unvis. It seems that piping keyboard commands through vis makes French accented characters appear in the terminal window and even in vi (although vi complains at start-up about needing to be piped through stdin and stdout). The problem with vi is that when I look at the file after saving it, the characters have returned to a character code (not octal, in fact, resembling more the keystroke command sequences of emacs, but I
haven't tried it with ISO-Latin-1, yet to see if that makes a difference). So if someone can suggest how to pipe a terminal session through vis, it might be a way to get foreign (at least for anglophones) characters in terminal mode.



[ Reply to This | # ]
French characters
Authored by: rv on Dec 08, '04 11:05:25AM

Great, this works!

Still, 'more' does not like characters more than 7 bits. I shall read the man to try to fix this problem.



[ Reply to This | # ]
French characters
Authored by: rv on Dec 08, '04 11:20:12AM

OK, once you've added in your .profile or whatever the piece of code provided by see, you can alias 'more' to 'more -r' to be able to read files with words like ÚtÚ, universit├á, tambiÚn... and much more!



[ Reply to This | # ]
Type ctrl-v before typing a special character
Authored by: liyanage on Mar 13, '02 02:24:32PM

If a program in the shell won't accept your characters even after switching to ISO-8859-1, try to type ctrl-v before. Nothing will happen visually after typing ctrl-v, but the next character should be accepted.

It might get displayed as octal sequence like 344 prefixed by a backslash (which I can't seem to type here...), but it should reach the program correctly.



[ Reply to This | # ]
Accents in terminal
Authored by: chtito on Mar 19, '02 09:36:26AM

I'm afraid the only way around is to use the zsh shell. It will allow you to use 8-bit characters. To my knowledge, this is impossible with tcsh, even with control-v. :o/



[ Reply to This | # ]
Icelandic characters
Authored by: Ermitgilsukaru on Mar 15, '02 06:47:49AM

I was wondering, does anybody know how to display Icelandic and other such obscure characters in the Terminal?



[ Reply to This | # ]
French characters in Terminal
Authored by: chtito on Dec 09, '04 02:09:04AM
One remark: latin-1 is not a good choice if you want to write in French, because it doesn't encode the character 'œ' which is comes up in many common words; the use of utf-8 is recommended instead (mac-roman also encodes 'œ' properly)

[ Reply to This | # ]