上传的文件内容被回显但不显示重音符号
INT. PALO TORCIDO HIGH SCHOOL, CAFETER�A - DAY
您好,我将 .txt 上传到我的服务器并使用 fopen/fread 获取内容,并且还使用 file_get_contents 以防万一。
我似乎不知道如何对特殊字符进行编码...
在我的 HTML 中,我将 UTF 设置为 8。我还尝试使用 PHP HEADER 来使用 UTF-8 编码。
处理包含不属于英文字母的字母的文件的正确方法是什么?
INT. PALO TORCIDO HIGH SCHOOL, CAFETER�A - DAY
Hi, I uploaded a .txt to my server and got the contents with fopen/fread and alsot used file_get_contents just in case.
I can't seem to figure out how to encode the special characters...
In my HTML i have my UTF set to 8. I also tried a PHP HEADER to use UTF-8 encoding.
what is the proper way to handle files with letters not part of the english alphabet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试 utf8_encode()
如果 *.txt 采用 Latin1 编码,则此方法有效。如果也可以使用其他编码,请使用 mb_detect_encoding() 检测编码并使用 mb_convert_encoding() 将其编码为 UTF8
Try utf8_encode()
This works if the *.txt is encoded in Latin1. If other encoding may be used too, detect the encoding using mb_detect_encoding() and encode it to UTF8 with mb_convert_encoding()