use utf8 并不能一直有效。
比如在DOS命令行里。只有GBK编码才能正常显示
但我的程序都是utf8的。
加了个
use encoding 'utf8',STDOUT=>'gbk';
如果用die输出中文,还是会出现乱码。

解决乱码的问题对我这样的菜鸟来说从没间断过。
后来我就一直保持使用utf8,确保方便找到问题。
有时是因为自己程序文件本身的编码错误和输出端错误的解码导致的。
像WEB,如果文件是utf8编码,但浏览器按GBK解码就会乱码。

哎。问题真的很多呀

2009/12/4 Mike.G <[email protected]>

> 还真没试过。
>
>
>
> 2009/12/4 Beckheng Lam <[email protected]>
>
>>  这个,我知道。:)
>>
>> 顺路问一下,use utf8后,使用tt2的filter会不会乱码?
>>
>>
>> Mike.G wrote:
>>
>> Mason?
>> 我们讨论的是TT2.
>> use utf8;
>>
>> 就可以了。
>>
>>
>> 2009/12/4 Beckheng Lam <[email protected]>
>>
>>> 小试了一下,貌似use encoding 'utf8'要放在各个Mason componment显式调用,才能生效
>>>
>>>
>>>
>>
>>
>>
>>
>> --
>> Perl乐事 -- http://www.perlersh.org
>> 我的博客 -- http://www.perlersh.org/blog.html
>> 揭谛揭谛,波罗揭谛,波罗僧揭谛,菩提萨婆诃。
>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。
 要在此论坛发帖,请发电子邮件到 [email protected]
 要退订此论坛,请发邮件至 [email protected]
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

回复