将 Word 文本粘贴到 utf-8 HTML 文件中
背景:我在工作中创建了大量广播电子邮件,这些电子邮件的内容通常以 Word 文档形式发送给我。我使用 XHTML 1.0 Transitional 文档类型和 UTF-8 字符集对电子邮件进行手工编码。
我的问题:将从 MS Word 复制的文本转换为 UTF-8 以便我可以将其粘贴到 XHTML 文件中的最快方法是什么?
现在...我在 Coldfusion 中创建了自己的字符编码转换器,但它非常初级,只有在我指定“问题字符”时才处理它们,并且一次只能处理一个。示例:
function HTMLEncode(string) {
string = Replace(string, '&', '&', 'ALL');
string = Replace(string, '©', '©', 'ALL');
string = Replace(string, '—', '-', 'ALL');
...
必须有更好/更简单/更快的方法。有什么建议吗?
Background: I create a lot of broadcast e-mails at my job, and the content for these e-mails are usually sent to me in a Word document. I hand-code my e-mails with an XHTML 1.0 Transitional doctype and UTF-8 character set.
My question: What's the fastest way to convert text copied from MS Word to UTF-8 so I can paste it into my XHTML files?
For now... I created my own character encoding converter in Coldfusion, but it's very rudimentary and handles "problem characters" only if I specify them and only one at a time. Example:
function HTMLEncode(string) {
string = Replace(string, '&', '&', 'ALL');
string = Replace(string, '©', '©', 'ALL');
string = Replace(string, '—', '-', 'ALL');
...
There has to be a better/simpler/faster way. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试记事本++。有一个名为 TextFX 的插件可以为您完成此操作。如果没有,有很多可用的插件,所以您很可能会找到一个。
这是 notepad++ 插件 的链接
Try notepad++. There is a plugin called TextFX that might do this for you. If not, there are a lot of plugins available for it so chances are you might find one.
Here is the link for notepad++ plugins