LinuxSir.cn,穿越时空的Linuxsir!

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

GTK2国际化问题?

[复制链接]
发表于 2004-8-12 10:44:56 | 显示全部楼层 |阅读模式
>gedit net_config.po
> msgfmt net_config.po -o net_config.mo
net_config.po:118:11: invalid multibyte sequence
net_config.po:122:11: invalid multibyte sequence
net_config.po:126:11: invalid multibyte sequence
net_config.po:130:11: invalid multibyte sequence
net_config.po:134:11: invalid multibyte sequence
net_config.po:138:11: invalid multibyte sequence
msgfmt: found 6 fatal errors
如:
#: net_config.c:2211
msgid "year"
msgstr "年“

改”年“为”年份“时没有错误。
发表于 2004-8-12 12:57:15 | 显示全部楼层
把你的po文件头貼出来看看?
 楼主| 发表于 2004-8-12 13:04:10 | 显示全部楼层
1 # SOME DESCRIPTIVE TITLE.
      2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
      3 # This file is distributed under the same license as the PACKAGE package.
      4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
      5 #
      6 #, fuzzy
      7 msgid ""
      8 msgstr ""
      9 "roject-Id-Version: PACKAGE VERSION\n"
     10 "Report-Msgid-Bugs-To: \n"
     11 "OT-Creation-Date: 2004-08-12 10:09+0800\n"
     12 "O-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     14 "Language-Team: LANGUAGE <LL@li.org>\n"
     15 "MIME-Version: 1.0\n"
     16 "Content-Type: text/plain; charset=GBK\n"
     17 "Content-Transfer-Encoding: 8bit\n"

我是在rh7.3/9中,看看有没有办法。
发表于 2004-8-12 13:45:51 | 显示全部楼层
请用 iconv 把你的 po 文件的编码转成 UTF-8 的,也可以用 gedit 保存成 UTF-8 的编码。
只有用 UTF-8,msgfmt 才能编译你的 po 文件
 楼主| 发表于 2004-8-12 14:09:48 | 显示全部楼层
我是在gedit中选utf8保存,用 iconv -t utf8 net_config.po,会在第一个
错误处中断:illegal input sequence at position 2211

能说说你们用的工具吗?
发表于 2004-8-12 17:56:49 | 显示全部楼层
"Content-Type: text/plain; charset=GBK\n"
如果你用utf-8保存,这一行要改成
"Content-Type: text/plain; charset=UTF-8\n"

你还可以用kbabel来编辑po文件,它会作一些语法检查
 楼主| 发表于 2004-8-12 18:46:09 | 显示全部楼层
我用kbabel后,可以用msgfmt生成.mo文件,但是执行程序时,界面
上没有显示。
报错:
WARNING **: Invalid UTF8 string passed to pango_layout_set_text()
发表于 2004-8-12 18:59:56 | 显示全部楼层
程序中是否加了这几行?

  1.   bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
  2.   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
  3.   textdomain (GETTEXT_PACKAGE);
复制代码
 楼主| 发表于 2004-8-12 19:01:31 | 显示全部楼层
程序运行时,是空白或乱码.
我在Fc2中试过,和现码情况一样.
发表于 2004-8-12 19:03:48 | 显示全部楼层
能否贴出源码?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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