douchuxun4162 2014-08-06 07:31
浏览 26
已采纳

在ASCII文件中包含UTF8文件

In the project I'm working there are lots of ASCII files. A file that is included in all files needs to be UTF8 in order to work properly.

What problems I might face if I include an UTF8 file in ASCII and visa versa?

include 'x.php'

I couldn't find any free tool to convert files to UTF8 encoding in bulk, for windows.

Edit: x.php have a function to convert utf8 text to ascii. ascii encoded php files includes x.php and use the function.

  • 写回答

1条回答 默认 最新

  • doushanmo7024 2014-08-06 07:38
    关注

    A pure 7-bit ASCII file is an exact subset of UTF-8 (note that doesn't hold true for extended 8-bit ASCII). If you mix ASCII and UTF-8 files, the result will all be valid UTF-8. If you tried to convert ASCII to UTF-8, you'd end up with the same ASCII file; it's already valid UTF-8.

    As long as whatever you're doing with those files handles UTF-8 correctly, you're already handling ASCII correctly as well.

    You may want to read What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请问如何在openpcdet上对KITTI数据集的测试集进行结果评估?
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错