如何使用 Notepad++ 将 ANSI 编码的文件转换为 UTF-8? [英] How do I convert an ANSI encoded file to UTF-8 with Notepad++?

查看:42
本文介绍了如何使用 Notepad++ 将 ANSI 编码的文件转换为 UTF-8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,我可以在 Firefox 中使用 jQuery 发送我的土耳其语字符,但 Internet Explorer 不发送我的土耳其语字符.我在记事本中查看了我的源文件,该文件的代码页是 ANSI.

I have a website, and I can send my Turkish characters with jQuery in Firefox, but Internet Explorer doesn't send my Turkish characters. I looked at my source file in notepad, and this file's code page is ANSI.

当我将它转换为没有 BOM 的 UTF-8 并关闭文件时,当我重新打开时,文件又是 ANSI.

When I convert it to UTF-8 without BOM and close the file, the file is again ANSI when I reopen.

如何将我的文件从 ANSI 转换为 UTF-8?

How can I convert my file from ANSI to UTF-8?

推荐答案

关于这部分:

当我将它转换为没有 bom 的 UTF-8 并关闭文件时,当我重新打开时,该文件又是 ANSI.

When I convert it to UTF-8 without bom and close file, the file is again ANSI when I reopen.

最简单的解决方案是通过正确配置 Notepad++ 来完全避免该问题.

The easiest solution is to avoid the problem entirely by properly configuring Notepad++.

尝试Settings -> Preferences -> New document -> Encoding -> 选择UTF-8 没有BOM,勾选Apply to open ANSI files.

Try Settings -> Preferences -> New document -> Encoding -> choose UTF-8 without BOM, and check Apply to opened ANSI files.

这样所有打开的 ANSI 文件都将被视为没有 BOM 的 UTF-8.

That way all the opened ANSI files will be treated as UTF-8 without BOM.

要了解发生了什么,请阅读此答案下方的评论.

For explanation what's going on, read the comments below this answer.

要全面了解 Unicode 和 UTF-8,请阅读 这篇来自 Joel Spolsky 的优秀文章.

To fully learn about Unicode and UTF-8, read this excellent article from Joel Spolsky.

这篇关于如何使用 Notepad++ 将 ANSI 编码的文件转换为 UTF-8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆