LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1161|回复: 8

who can give the chinese input a final explanation?

[复制链接]
发表于 2005-8-3 06:31:07 | 显示全部楼层 |阅读模式
I am a debian newer.I use the "fcitx" as the input.However,the result comes bad.

first, the problem i'm courtering is that,the chinese word also appeard, but when i press the space or enter key,there is nothing in the input text-box.

second, i have search the bbs and www here and there,there are so many methods about the fcitx chinese input problem. who can give a final explanation,together with why do this and why not do that?

third,i have some confused problems as follows:
my debian version is "Linux debian 2.6.8-2-386 #1 Thu May 19 17:40:50 JST 2005 i686 GNU/Linux"

1.some people give the sugguestion that run " /usr/sbin/dpkg-reconfigure localesu
" and choose " zh_CN.GB2312
zh_CN.GBK
zh_CN.UTF-8"

i follow this to find that it can't not to be choosen three option one time, why? then i try to edit the " /etc/locale.gen" file manually.and save the edit and run "locale-gen".

when the text is"" zh_CN.GB2312
zh_CN.GBK
zh_CN.UTF-8"
the "locale-gen" command run successfully.

however,when the text order was changed to
" zh_CN.GBK
  zh_CN.GB2312
  zh_CN.UTF-8"
the "locale-gen" command run wrong,give the message

"Generating locales...
error: Bad entry 'zh_CN.GB2312 '
error: Bad entry 'zh_CN.GBK '
error: Bad entry 'zh_CN.UTF-8 '
Generation complete."

why? and what's the function of the file "locales"?


2. about some resolve

the most common method seen is something like

"在/etc/X11/Xsession.d/25xchinput-start此文件中设置的是GBK,会不会是这个问题?
export G_FILENAME_ENCODING=@GBK
export LANG=zh_CN.GB2312
export XMODIFIERS=@im=fcitx
fcitx"


or
"在/etc/X11/Xsession.d/下新建一个文件,如95im-launch,输入内容如下:
export LC_ALL=zh_CN.GB2312
export LANG=zh_CN
export XMODIFIERS=@im=fcitx
fcitx"

or
"export G_FILENAME_ENCODING=@GBK
export LANG=zh_CN.GBK
#export LANG=zh_CN.UTF-8
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE="fcitx"
fcitx"
我的写在 /etc/X11/Xsession.d/25input 里面"

or
"apt-get install fcitx
echo " export XMODIFIERS=@im=SCIM ; fcitx " > /etc/X11/Xsession.d/95im-launch"


I've got that the file name "95im-launch" or "25xchinput-start" not result in differences.
But what about the sentences begin with "export"?
which "export" sentences is actually needed? and why ?
and what the relationship between "locale"(first question) and this question(second question)?

3. even more some friends point that edit the "~./xinitrc" with the question 2 mentioned methods also work. but i can't even find the "~./xinitrc" file.
when i use the "ls -a" command i got the following

---------------------------------------------------------------------
.              .dmrc           .gnome2_private    .totem.drawfoot
..             .fcitx          .gstreamer-0.8     .viminfo
.AbiSuite      .fonts.cache-1  .gtkrc-1.2-gnome2  .xine
.ICEauthority  .gconf          .metacity          .xsession-errors
.Xauthority    .gconfd         .mozilla           Desktop
.bash_history  .gksu.lock      .nautilus          music
.bash_profile  .gnome          .recently-used
.bashrc        .gnome2         .thumbnails
---------------------------------------------------------------------

Is this my debian version problem or my problem?
Is the "~/.xinitrc" file the same as "/etc/X11/xinit/xinitrc"?
and is the question 3 work to my chinese input problem?


i'am helpless. who can explain these confuses? Thank you very much!!!!thank you!!!
发表于 2005-8-3 08:48:10 | 显示全部楼层
I am a debian newer.I use the "fcitx" as the input.However,the result comes bad.


Greetings. I don't use fcitx. After all these failures, why not give scim a try?


first, the problem i'm courtering is that,the chinese word also appeard, but when i press the space or enter key,there is nothing in the input text-box.


Sounds strange. Don't know why. Again, try scim.

second, i have search the bbs and www here and there,there are so many methods about the fcitx chinese input problem. who can give a final explanation,together with why do this and why not do that?


Yes. The sheer number of responses and the variety of approaches really get on my nerves as well.
You want a final explanation? I am afraid there isn't. Personally I don't know why I do this, but I know if I do this, I will get this result. Same thing here with input method.

third,i have some confused problems as follows:
my debian version is "Linux debian 2.6.8-2-386 #1 Thu May 19 17:40:50 JST 2005 i686 GNU/Linux"

1.some people give the sugguestion that run " /usr/sbin/dpkg-reconfigure locales
" and choose " zh_CN.GB2312
zh_CN.GBK
zh_CN.UTF-8"

i follow this to find that it can't not to be choosen three option one time, why? then i try to edit the " /etc/locale.gen" file manually.and save the edit and run "locale-gen".

You can. You can just use 'space' key to choose as many as you want.


when the text is"" zh_CN.GB2312
zh_CN.GBK
zh_CN.UTF-8"
the "locale-gen" command run successfully.

however,when the text order was changed to
" zh_CN.GBK
  zh_CN.GB2312
  zh_CN.UTF-8"
the "locale-gen" command run wrong,give the message

"Generating locales...
error: Bad entry 'zh_CN.GB2312 '
error: Bad entry 'zh_CN.GBK '
error: Bad entry 'zh_CN.UTF-8 '
Generation complete."


Here it says bad entry, I guess your locale names are not correct. Here are some entries in my locale.gen

  1. zh_CN.GB18030 GB18030
  2. zh_CN GB2312
  3. zh_CN.GBK GBK
  4. zh_CN.UTF-8 UTF-8
复制代码


You see. Different from yours. But using dpkg-reconfigure locales is easier. Remeber just use 'space' to choose the onces you want.


why? and what's the function of the file "locales"?


hmm, you know the word: locale right? When in Rome, do as Romans do. In China, the money sign is ¥, but in the U.S, the money sign is $. You see? When you set locales into zh_CN, then of course Date format, measure system etc, will all comply with Chinese habits or standards. That's my understanding.


2. about some resolve

the most common method seen is something like

"在/etc/X11/Xsession.d/25xchinput-start此文件中设置的是GBK,会不会是这个问题?
export G_FILENAME_ENCODING=@GBK
export LANG=zh_CN.GB2312
export XMODIFIERS=@im=fcitx
fcitx"


or
"在/etc/X11/Xsession.d/下新建一个文件,如95im-launch,输入内容如下:
export LC_ALL=zh_CN.GB2312
export LANG=zh_CN
export XMODIFIERS=@im=fcitx
fcitx"

or
"export G_FILENAME_ENCODING=@GBK
export LANG=zh_CN.GBK
#export LANG=zh_CN.UTF-8
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE="fcitx"
fcitx"
我的写在 /etc/X11/Xsession.d/25input 里面"

or
"apt-get install fcitx
echo " export XMODIFIERS=@im=SCIM ; fcitx " > /etc/X11/Xsession.d/95im-launch"


Double check that you have your locales set up correctly, then you can try these methods. I guess the main reason you didn't get fcitx working is that you didn't configure locale correctly.

I've got that the file name "95im-launch" or "25xchinput-start" not result in differences.
But what about the sentences begin with "export"?
which "export" sentences is actually needed? and why ?


Want to know what export does? Simple. Just type in your console evn  (means environment) and you will see your environment settings.
Can you change some of them? Of course. How to change them? Use, export. export is basically a command that modifies or set new environment settings.

Try this:

export TEST="Here is an example of export"
echo $TEST

So when other applications want to use the value of TEST, by exporting it, they know that TEST means 'here is an example of export' and can actually start using it.
and what the relationship between "locale"(first question) and this question(second question)?


You need to let fcitx know what is the LANG environment, what is the XMODIFIERS environment. Otherwise, it refuses to work.

3. even more some friends point that edit the "~./xinitrc" with the question 2 mentioned methods also work. but i can't even find the "~./xinitrc" file.
when i use the "ls -a" command i got the following

---------------------------------------------------------------------
.              .dmrc           .gnome2_private    .totem.drawfoot
..             .fcitx          .gstreamer-0.8     .viminfo
.AbiSuite      .fonts.cache-1  .gtkrc-1.2-gnome2  .xine
.ICEauthority  .gconf          .metacity          .xsession-errors
.Xauthority    .gconfd         .mozilla           Desktop
.bash_history  .gksu.lock      .nautilus          music
.bash_profile  .gnome          .recently-used
.bashrc        .gnome2         .thumbnails
---------------------------------------------------------------------

Is this my debian version problem or my problem?
Is the "~/.xinitrc" file the same as "/etc/X11/xinit/xinitrc"?
and is the question 3 work to my chinese input problem?


What windows manager you use? KDE? Gnome? Right now, you don't need to create or modify .xinitrc if you use KDE or gnome. This file is useful when you use other lighter, sleek windows managers like fluxbox, evilwm or ion2.


Here is a summary:

1. use dpk-reconfigure to generate your locales. Make sure they are working in the first place.
2. use one of the methods you discovered to export the values fcitx needed.
Perhaps you can try this:

export G_FILENAME_ENCODING=@GBK
export LANG=zh_CN.GBK
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE="fcitx"

Make sure you have GBK locale ready before you try it.




I'm helpless. who can explain these confuses? Thank you very much!!!!thank you!!!


Don't worry. Everything will be fine.
回复 支持 反对

使用道具 举报

发表于 2005-8-3 14:36:42 | 显示全部楼层
scim好象是日本鬼子的东西, 不到万不得已坚决不用.

按照fcitx的说明, 安装和配置应该很简单很简单. 我安装时无论用RPM, 还时源代码编译, 都从来没有出过毛病. 对了, 好象安装fcitx的时候, 一定要先去掉其他的输入法, 譬如Minichinput什么的.

配置对我来说永远是个headache, 按道理说, 只要XMODIFIERS设好, locale设好, fcitx应该没有问题了, 可是我在英文环境下还从来没有成功使用过fcitx呢.
回复 支持 反对

使用道具 举报

发表于 2005-8-3 15:02:34 | 显示全部楼层
Post by n00b
scim好象是日本鬼子的东西, 不到万不得已坚决不用.

我不同意。

首先,scim是地地道道的国货。当然也有各国人士参加开发,包括日本人。

其次,我不同意现在无理性的 民族主义 思想。 也许日本政客是坏的,一些日本人是邪的,但是不能说全日本都是坏的。

再次,你对日本真正了解多少?会日语吗?和多少日本人接触过?你不懂这个国家的语言和文化,还是不要妄下结论。

又次,日本人写的软件有的还是很好的。比如我用的w3m。 记得多年前的山口百惠、三浦友和,他们的电影感动了多少中国人。还有,铁臂儿童木。我也很喜欢。当然那是我们那个年代的事了。

我覺的还是应该就事论事,该是中华民族的利益我们要维护,但不要陷入盲目的 民族主义 当中。

你首先要了解清楚(包括日本这个国家、scim是谁开发的),再去作出你的判断。

Post by n00b

配置对我来说永远是个headache, 按道理说, 只要XMODIFIERS设好, locale设好, fcitx应该没有问题了, 可是我在英文环境下还从来没有成功使用过fcitx呢.


我在英文环境下用scim很好。不妨试试。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-3 17:10:54 | 显示全部楼层
monpython ,我刚起床,还没来得及试一下你的说明,你的回复太详细了,衷心感谢你!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-4 00:04:00 | 显示全部楼层
我的中文输入问题已解决,现我把一些心得归纳如下,希望能给予和我遇到相同问题的新手有所帮助。

我在配置过程中主要做了如下两个设置。

一个是 /etc/locale.gen,一个是/etc/X11/Xsession.d/95im-launch

我现在配置好了的情况下两个文件分别是

/etc/locale.gen:
--------------------
zh_CN.GBK GBK
zh_CN GB2312
zh_CN.UTF-8 UTF-8
--------------------

/etc/X11/Xsession.d/95im-launch:
---------------------------------
export LANG=zh_CN.GB2312
export LC_CTYPE="zh_CN"
export XMODIFIERS="@im=fcitx"
export XIM="fcitx"
---------------------------------

两个文件的说明--------
1、其中local.gen文件不推荐用vi编辑,而是用 dpkg-reconfigure locales命令在图形界面下编辑,分别选中
  • zh_CN GB2312
  • zh_CN.GBK GBK
  • zh_CN.UTF-8 UTF-8

    选择的时候用space键。接着,在下一个图形界面中选择“default locale”为 “zh_CN.GBK ",
    只要出现如下
    -------------------------
    Generating locales...
      zh_CN.GBK... done
      zh_CN.GB2312... done
      zh_CN.UTF-8... done
    Generation complete.
    -------------------------
    信息,则表明此文件配置成功。


    2、比较麻烦的是"/etc/X11/Xsession.d/95im-launch"文件,到现在我仍不清楚这个文件具体那个“export”语句是必须的。这个网页(http://www.fcitx.org/main/?q=node/74)有相关的一些说明。目前我认为
    -------------------------------
    export LC_CTYPE="zh_CN"
    export XMODIFIERS="@im=fcitx"
    -------------------------------
    这两句最重要。其它如

    export LANG=zh_CN.GB2312,也许可以换成“zh_CN.GBK"
    export XIM="fcitx", 也许可以省略。

    配置完成之后,要重启x-server,快捷键为“ctrl+alt+backspace”。
    这里我要说明的是,这样的方式启动的gnome似乎用的是上上次的配置文件。也就是说你刚才配好的文件必须重启两次x-server才能生效,这可是个烦人的问题啊~~~

    最后,再次感谢monpython 学长,谢谢他让我爬过第一个障碍。
  • 回复 支持 反对

    使用道具 举报

    发表于 2005-8-4 02:34:51 | 显示全部楼层
    您这个是debian底下的特别配置吧, 对别的系统好象没有太大帮助, 至少我的机器上没有你讲的那几个文件。

    还有有的人建议说修改~/.i18n里面的配置, 可是我的机器上没有.i18n的目录, fcitx究竟用不用.i18n的东西?
    回复 支持 反对

    使用道具 举报

    发表于 2005-8-4 03:21:05 | 显示全部楼层
    输入法和locale没有必然的关系,推荐都在utf8下使用,en_US.utf8还是zh_CN.utf8都能很好的使用任何输入法
    举一反三,大部分linux发行版可能有些文件结构不同,但是需要的功能都能实现的
    fedora是/etc/sysconfig/i18n
    debian是/etc/environment
    archlinux是/etc/profile
    功能一样,无非都是export一下变量而已,
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2005-8-4 05:40:59 | 显示全部楼层
    嗯,我的配置是针对debian系统的,原来我发在debian版的,后来斑竹移到这里来了。

    fallen,谢谢你的提醒,确实是只要utf-8编码就可以通用了。

    我原来的说法如下:

    /etc/X11/Xsession.d/95im-launch:
    ---------------------------------
    export LANG=zh_CN.GB2312
    export LC_CTYPE="zh_CN"
    export XMODIFIERS="@im=fcitx"
    export XIM="fcitx"
    ---------------------------------

    现改为
    /etc/X11/Xsession.d/95im-launch:
    ---------------------------------
    export LANG=zh_CN.UTF-8
    export XMODIFIERS="@im=fcitx"
    export XIM="fcitx"
    ---------------------------------

    其中,"export LANG=zh_CN.UTF-8"应该是你的默认locale.

    下面一段话是网上一个朋友说的,我觉得这段话已经把问题说的很清楚了。

    “zh_CN 是 zh_CN.GB2312 的别名而已
    zh_CN.* 和 *.UTF-8 的语言环境中,fcitx 都可以正常地运行,无所谓哪个语言环境更好。我觉得为了与世界接轨,只有用 zh_CN.UTF-8,因为所有人都可以使用 UTF-8 编码,而 GB* 只有大陆在使用”

    另,有的朋友发现不能用ctrl+shift切换,是不是选中了小企鹅状态条的“锁”图标,有的时候不能输入是不是选中了小企鹅的“全角”状态?
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    快速回复 返回顶部 返回列表