Bug 112180

Summary: Gnome terminal display Chinese characters incorrectly
Product: [Fedora] Fedora Reporter: Yidao Cai <yidao.cai>
Component: gnome-terminalAssignee: Alexander Larsson <alexl>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: eng-i18n-bugs, wtogami, yidao.cai
Target Milestone: ---Keywords: i18n
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-03 01:08:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yidao Cai 2003-12-15 19:36:05 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114

Description of problem:
I selected en_US as default when installed it. When I change character
coding by selecting "Terminal -> Character Coding" to either "Chinese
Simplified (GB10830)" or "Chinese Simplified (GB2312)", and use "vi"
to edit a GB text, there are Chinese characters displayed, but none of
them is correct. You will know instantly even if you cannot read and
understand Chinese. Similar error occurs for "Chinese Traditional
(BIG5)" and BIG5 text.

In RedHat 9.0, I can select language to Simplified Chinese before
login and display Chinese correctly, after I select the correct
character coding. But with Fedora Core 1, even this method does not work.

Version-Release number of selected component (if applicable):
gnome-terminal-2.4.0.1-1

How reproducible:
Always

Steps to Reproduce:
1. install Fedora core 1 with en_US locale
2. open gnome terminal
3. set "Terminal -> Character Coding" to "Simplified Chinese
(GB10830)" or "Simplified Chinese (GB2312)"
4. edit a GB text file using "vi" 

Actual Results:  The GB text is displayed incorrectly. There are
Chinese characters displayed on the screen, but they are not what the
text actually is.

Expected Results:  GB text should be displayed correctly.

Additional info:

With a gnome terminal, when proper Character Coding is selected, text
files with that coding should be displayed correctly, regardless of
the locale setting. Otherwise why allow people to select other
character codings?

Comment 1 Warren Togami 2004-04-14 04:03:36 UTC
ping

Comment 2 Warren Togami 2004-04-14 04:04:19 UTC
Yidao Cai, can you see if you still have this problem with FC2
development?

Comment 3 Yidao Cai 2004-04-14 14:21:30 UTC
I did not test FC2, and I probably will not have time to test it
before it is released. The test procedure published on web site only
uses gEdit for testing, not gnome terminal or other applications. I
think that has to be changed. 

Comment 4 Akira TAGOH 2004-04-20 02:45:32 UTC
as long as you use the command like cat, which outputs the characters
to the character device directly, it should works regardless of the
locale setting, yes. but gnome-terminal will decides the initial
encoding from the current locale when it's run. and almost
applications needs the correct locale setting to take care of their
native languages. as you mentioned in the first comment, you may be
missing the proper locale to work the applications for Chinese.
So please make sure whether it works or not, when the locale is set
properly.

BTW the reason allow to change the encoding is people wants to change
the encoding without restarting the terminal.

Comment 5 Yidao Cai 2004-04-20 15:21:54 UTC
"cat" works fine as you suggested, but "vi" does not, whether I select
language as English or Chinese before login.

I think I have installed everything that's needed. If I were right,
the language selection process before login sets the local to either
English or Chinese.

BTW, everything works fine in RedHat 9.0, and I did not do anything
different with FC1.

Comment 6 Akira TAGOH 2004-04-21 08:36:58 UTC
Well, you say even if you choose Simplified Chinese on gdm, and login
then, vi doesn't work with Simplified Chinese on gnome-terminal by
default, right?
If you mean vi on gnome-terminal doesn't show GB2312 and/or GB18030
text, please read RELEASE-NOTES. we did migrate the locale and the
encoding to UTF-8 since FC1, and you are running UTF-8 locale now. so
what you expect here may be:
$ LANG=zh_CN.GB18030 gnome-terminal --disable-factory
(on realized gnome-terminal)
$ export LANG=zh_CN.GB18030
$ vi foo

it should works. and this isn't a bug then, because vi and
gnome-terminal refers the current locale, and the current locale isn't
zh_CN.GB18030 and zh_CN.GB2312 either, which you expected.

Comment 7 Yidao Cai 2004-04-21 15:23:03 UTC
Yes, the above works fine. Thanks.

To summarize, regardless you select the language as Simplified Chinese
before you login, you have to do these two steps to display GB2312 or
GB18030 Chinese characters with vi:

1. $ export LANG=GB18030 (or GB2312)
2. choose "Terminal" --> "Character Coding" --> "GB2312" or "GB18030".

If you do not select Simplified Chinese before login, you can only
view/delete Chinese characters in vi but not be able to input Chinese
characters. If you select Simplified Chinese before login, then you
will have a full functional Chinese environment.

I did not test for Traditional Chinese but I think it will be similar.

I can understand that UTF is the way to go, but in the meantime, GB or
Big5 is not going away in a short time. So I have these suggestions:

1. option to select locale on gdm, to change locale for all applications.

2. on gnome-terminal, add option to change locale, or always using the
matching local for the Character Coding chosen.

At the minimal, easy-to-find information on this subject should be
helpful.



Comment 8 Akira TAGOH 2004-04-22 05:15:44 UTC
Hmm, actually the languages selection on gdm is to change the locale.
I assume you mean something like "Simplified Chinese (GB18030)" should
be added, right? then it won't be fixed since we have decided to
migrate CJK locale to UTF-8 on FC1 and later.
BTW IIIMF works on even UTF-8 locale to input the native languages.

Comment 9 Leon Ho 2004-06-03 01:08:48 UTC
LANG=zh_CN.GB18030 gnome-terminal --disable-factory should be fine. We
may thinking of writing a FAQ or some sort for dealing with this type
of native encoding vs UTF-8 issue. Thanks!