With a utf8-encoded Perl script, can it open a filename encoded as GB2312?

淺唱寂寞╮ 提交于 2019-12-01 13:29:26

If you

 use utf8;

in your Perl script, that merely tells perl that the source is in UTF-8. It doesn't affect how perl deals with the outside world. Are you turning on any other Perl Unicode features?

Are you having problems with every filename, or just some of them? Can you give us some examples, or a small demonstration script? I don't have a filesystem that encodes names as GB2312, but have you tried encoding your filenames as GB2312 before you call open?

If you want specific strings encoded with a specific encoding, you can use the Encode module. Try that with your filenames that you give to open.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!