+ -
当前位置:首页 → 问答吧 → 关于MDV2006中perl使用时的locale的设置问题

关于MDV2006中perl使用时的locale的设置问题

时间:2005-11-01

来源:互联网

我在在使用perl时提示这样的错误:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "zh_CN.GBK:zh_CN.GB2312:zh_CN:zh",
LC_ALL = "zh_CN.gbk",
LC_PAPER = "en_US",
LC_ADDRESS = "en_US",
LC_MONETARY = "en_US",
LC_SOURCED = "1",
LC_NUMERIC = "en_US",
LC_TELEPHONE = "en_US",
LC_MESSAGES = "zh_CN",
LC_IDENTIFICATION = "en_US",
LC_COLLATE = "zh_CN",
LC_MEASUREMENT = "en_US",
LC_CTYPE = "zh_CN",
LC_TIME = "zh_CN",
LC_NAME = "en_US",
LANG = "zh_CN.gbk"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

当我$locale 后
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=zh_CN.gbk
LC_CTYPE="zh_CN.gbk"
LC_NUMERIC="zh_CN.gbk"
LC_TIME="zh_CN.gbk"
LC_COLLATE="zh_CN.gbk"
LC_MONETARY="zh_CN.gbk"
LC_MESSAGES="zh_CN.gbk"
LC_PAPER="zh_CN.gbk"
LC_NAME="zh_CN.gbk"
LC_ADDRESS="zh_CN.gbk"
LC_TELEPHONE="zh_CN.gbk"
LC_MEASUREMENT="zh_CN.gbk"
LC_IDENTIFICATION="zh_CN.gbk"
LC_ALL=zh_CN.gbk

我自己定义那些变量失败后,运行localedrake 设置语言,重启后还是失败,请问还有别的什么方法来解决这个问题吗?或者说应该怎样正确的设置locale呢?
不知道还有别人遇到过类似的问题吗?请高手指教一下
谢谢!

作者: Beiune   发布时间: 2005-11-01

你设的是自己的还是系统的?

作者: maramail   发布时间: 2005-11-01

自己的,
是不是要设为系统的。
使用export?

作者: Beiune   发布时间: 2005-11-01

guji shi

作者: maramail   发布时间: 2005-11-01

说句话:Perl和locale是没有关系的

作者: parset   发布时间: 2005-11-01

设为系统的变量还是不行。

说句话:Perl和locale是没有关系的------- 请问该怎么改呢?
请指教一下

作者: Beiune   发布时间: 2005-11-02

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

这个好象有问题,试试把它#了

作者: maramail   发布时间: 2005-11-02

你是运行的什么Perl
perl -v也有这个错误提示么?

作者: parset   发布时间: 2005-11-02

[beiune@localhost ~]$ perl -v
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "zh_CN.GBK:zh_CN.GB2312:zh_CN:zh",
LC_ALL = "zh_CN.gbk",
LC_PAPER = "en_US",
LC_ADDRESS = "en_US",
LC_MONETARY = "en_US",
LC_SOURCED = "1",
LC_NUMERIC = "en_US",
LC_TELEPHONE = "en_US",
LC_MESSAGES = "zh_CN",
LC_IDENTIFICATION = "en_US",
LC_COLLATE = "zh_CN",
LC_MEASUREMENT = "en_US",
LC_CTYPE = "zh_CN",
LC_TIME = "zh_CN",
LC_NAME = "en_US",
LANG = "zh_CN.gbk"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

This is perl, v5.8.7 built for i386-linux
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2005, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

作者: Beiune   发布时间: 2005-11-03

http://www.linuxsir.org/bbs/showthread.php?t=227268
先救一下急。。

作者: csyfek   发布时间: 2005-11-03

按照这个方法改了之后,
可以运行出结果了,
但是上面提到的那些warning还是出现

引用:
作者: csyfek
http://www.linuxsir.org/bbs/showthread.php?t=227268
先救一下急。。

作者: Beiune   发布时间: 2005-11-03

这个恐怕要到编程版问一下,我对perl一点也不懂。。。不过我的 perl -v 的结果应该没问题吧。
PHP 代码:
[shine@localhost ~]$ perl -v

This is perl, v5.8.7 built for i386-linux
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2005, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl.  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page. 

作者: csyfek   发布时间: 2005-11-03