windows TextPad 和 Unicode:完全支持?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8879277/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 09:06:55  来源:igfitidea点击:

TextPad and Unicode: full support?

windowsunicodetextpad

提问by PaulJ

I've got some UTF-8 files created in Mac, and when trying to open them using TextPad in Windows, I get the following warning:

我在 Mac 中创建了一些 UTF-8 文件,当尝试在 Windows 中使用 TextPad 打开它们时,我收到以下警告:

WARNING: (file name) contains characters that do not exist in code page 1252 (ANSI Latin 1). They will be converted to the system default character, if you click OK.

警告:(文件名)包含代码页 1252(ANSI 拉丁语 1)中不存在的字符。如果单击“确定”,它们将被转换为系统默认字符。

Linux (GNOME gEdit) can open the same file without complaints. What does the above mean? I thought that TextPad had full UTF-8 support. Can I safely open and edit UTF-8 files using it without corrupting the file?

Linux (GNOME gEdit) 可以毫无怨言地打开同一个文件。以上是什么意思?我认为 TextPad 具有完整的 UTF-8 支持。我可以使用它安全地打开和编辑 UTF-8 文件而不损坏文件吗?

采纳答案by Jukka K. Korpela

It seems that TextPad cannot handle characters outside windows-1252 (CP1252, here carrying the misnomer “ANSI Latin 1”). I tested it on Windows, opening a plain text file created on the same system, as UTF-8 encoded, both with and without BOM, with the same result. The program's help does not seem to contain anything related to character encodings, and its tools for writing “international characters” are for Latin-1 characters only.

似乎 TextPad 无法处理 windows-1252 之外的字符(CP1252,这里带有误称“ANSI Latin 1”)。我在 Windows 上测试了它,打开在同一系统上创建的纯文本文件,UTF-8 编码,有和没有 BOM,结果相同。该程序的帮助似乎不包含任何与字符编码相关的内容,其用于编写“国际字符”的工具仅适用于 Latin-1 字符。

There are several text editors for Windows that can deal with UTF-8 (even Notepad can open a UTF-8 file, but it can hardly be recommended for serious editing). See Alan Wood's collection of information on Unicode editors and word processors for Windows. (Personally, I like Notepad++ and BabelPad, which are both free.)

有几种适用于 Windows 的文本编辑器可以处理 UTF-8(即使记事本也可以打开 UTF-8 文件,但很难推荐它进行认真的编辑)。请参阅 Alan Wood 收集的有关适用于 Windows 的 Unicode 编辑器和文字处理器的信息。(就我个人而言,我喜欢 Notepad++ 和 BabelPad,它们都是免费的。)

回答by Lawrence Dol

TextPad 8, the newest as of 2016-01-28, does finallyproperly support BMP Unicode. It's a paid upgrade, but so far has been working flawlessly for me.

2016 年 1 月 28 日最新的 TextPad 8终于正确支持 BMP Unicode。这是付费升级,但到目前为止对我来说一直完美无缺。

回答by bobince

TextPad ‘supports' UTF-8 and UTF-16 documents only in as much as it will import and export them. But it still edits files as simple bytes, and not Unicode characters (using the ANSI code page, which is code page 1252 for Western European).

TextPad '支持' UTF-8 和 UTF-16 文档,只是因为它可以导入和导出它们。但它仍然将文件编辑为简单的字节,而不是 Unicode 字符(使用 ANSI 代码页,即西欧代码页 1252)。

So unless the file happened to contain only characters that also exist in that code page, you will lose content. This rather defeats the point of Unicode.

因此,除非文件碰巧只包含在该代码页中也存在的字符,否则您将丢失内容。这反而违背了 Unicode 的意义。

Indeed, this was the issue that made me flee—to EmEditor, at the time, though now I would agree with the previous comments and recommend Notepad++. The era of paying for text editors is long gone.

确实,这就是当时让我逃离的问题——当时我选择了 EmEditor,尽管现在我同意之前的评论并推荐 Notepad++。为文本编辑器付费的时代早已一去不复返了。

回答by Warren Rox

Actually TextPad does support displaying Unicode code points granted they went about it the wrong way. In order to display the Unicode characters you have to choose Configure->Preferences and expand "Document Classes->Text->Font.

实际上 TextPad 确实支持显示 Unicode 代码点,因为他们以错误的方式处理它。为了显示Unicode字符,您必须选择配置->首选项并展开“文档类->文本->字体”。

You need to choose a Unicode font AND set the Script to match. E.g. Arial Unicode MS with script CHINESE_BIG5.

您需要选择 Unicode 字体并将脚本设置为匹配。例如带有脚本 CHINESE_BIG5 的 Arial Unicode MS。

However, this is a backward approach since the application should handle this when the user tells TextPad to open the file in Unicode or UTF-8. The built in Notepad application with MS Windows will detect the encoding automatically and display the glyphs correctly based upon the encoding.

但是,这是一种落后的方法,因为当用户告诉 TextPad 以 Unicode 或 UTF-8 格式打开文件时,应用程序应该处理此问题。带有 MS Windows 的内置记事本应用程序将自动检测编码并根据编码正确显示字形。

回答by Jeff Bunting

I found a discussion on this in the Textpad forums: http://forums.textpad.com/viewtopic.php?t=11019

我在 Textpad 论坛中找到了关于此的讨论:http://forums.textpad.com/viewtopic.php?t= 11019

While I have Notepad++, Textpad handles large files with ease while other editors I've tried, including Notepad++, either slow to a crawl or die. I'm currently trying to edit a 475MB file and Notepad++ is not up to the task.

虽然我有 Notepad++,但 Textpad 可以轻松处理大文件,而我尝试过的其他编辑器,包括 Notepad++,要么爬得慢,要么死了。我目前正在尝试编辑一个 475MB 的文件,而 Notepad++ 无法完成任务。

回答by Partha Choudhury

Textpad Configure Menu --> Preferences --> Document Classes --> Default --> Default encoding --> UTF-8

文本板配置菜单 --> 首选项 --> 文档类 --> 默认 --> 默认编码 --> UTF-8

回答by Rinus

Try the ANSI code set with File/Open, that should solve the problem in TextPad

尝试使用 File/Open 设置的 ANSI 代码,应该可以解决 TextPad 中的问题