Red Hat Bugzilla – Bug 88736
lack of 8-bit ascii support
Last modified: 2007-04-18 12:53:00 EDT
Description of problem: Trying to view an 8-bit ascii file (french text) in Vim in gnome-terminal, the french symbols are displayed as either '?', or not at all. This works fine in xterm, with no modifications. Version-Release number of selected component (if applicable): gnome-terminal-2.0.1-5 How reproducible: Open a file with 8-bit ascii, using vim in terminal mode. Additional info: I will attach an appropriate file.
Created attachment 91101 [details] xml file containing 8-bit ascii
There's no such thing as "8-bit ascii" - ascii is 7-bit. Your file is in Latin-1. To view Latin-1 in Red Hat Linux 8, you have to run the terminal in a Latin-1 locale. LANG=fr_FR.ISO88591 or something along those lines. In Red Hat Linux 9, the terminal has a menu called Encoding where you can select Latin-1 regardless of your locale. Alternatively, use the "iconv" command to convert your file to UTF-8.
Put 8-bit ascii in google, and perform a search. I think you'll find the term is heavily used. You're arguing semantics. I just tried "LANG=fr_FR.ISO88591 vim <filename>". That did not fix the problem. Also, please explain why xterm does not have these difficulties. Does it just support these character sets "out of the box", as it were? I had no such difficulties with gnome-terminal under RedHat 7.3.
I'm not arguing semantics, I'm explaining how it works. "LANG=fr_FR.ISO88591 vim <filename>" doesn't help, because the issue is with the terminal expecting UTF-8 output. Putting vim in a Latin-1 locale isn't going to correct that. To run the terminal in a Latin-1 locale, you would do something like: "LANG=fr_FR.ISO8859-1 gnome-terminal --disable-factory" The reason 7.3 is different is that 7.3 did not default to UTF-8 locales. In any case, the problem is simple; you have to tell the terminal what encoding the stuff inside it will be in. In RHL 8, that encoding is the locale encoding; in RHL 9, that encoding is the locale encoding by default but there's a menu to override it. Alternatively, you can re-encode your file, using iconv.
> I'm not arguing semantics, I'm explaining how it works. My apologies. I shouldn't take my frustration out on you. > "LANG=fr_FR.ISO88591 vim <filename>" doesn't help, because the issue is with > the terminal expecting UTF-8 output. Putting vim in a Latin-1 locale isn't > going to correct that. Right... > To run the terminal in a Latin-1 locale, you would do something like: > "LANG=fr_FR.ISO8859-1 gnome-terminal --disable-factory" en_CA seems to work nicely. I'm not sure why --disable-factory is required, but it certainly seems to be. > The reason 7.3 is different is that 7.3 did not default to UTF-8 locales. Ah, understood. > In any case, the problem is simple; you have to tell the terminal what > encoding the stuff inside it will be in. In RHL 8, that encoding is the > locale encoding; > > in RHL 9, that encoding is the locale encoding by default but there's a menu > to override it. I'm using Fedora now, and I've found the encodings menu, and added the western ISO encoding I needed to display latin1. I don't see how to make it the default for all new terminals. Is there a way to do that, either in gnome-terminal or in the gconf registry? > Alternatively, you can re-encode your file, using iconv. Nice. I had no idea. Thanks.