将 wingdings(等)从 Word 文档复制到 html 文本字段

发布于 2024-07-19 06:09:04 字数 204 浏览 3 评论 0原文

当我使用 Windgings 作为字体在 Word 中写出一些文本(标准英语,没有花哨的字符)时,复制文本并粘贴到 html 文本字段中会导致操作系统显示“我不知道这是什么字符”字符(小方块)在 Windows 上)。

似乎更改字体(应该是仅显示属性)会阻止文本正确粘贴到输入字段中。

为什么不直接粘贴文字呢? 我能做些什么来阻止“小方块”问题吗?

When I write out some text (standard English, no fancy characters) in Word using Windgings as a font, copying the text and pasting into an html textfield results in the OS's "I don't know what character this is" characters (little squares on Windows).

It seems that changing the font (what should be a display-only property) is preventing the text from being pasted correctly into the input field.

Why does it not paste the text directly?
Is there anything I can do to stop the 'little squares' problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅唱ヾ落雨殇 2024-07-26 06:09:04

这里有两个问题:

  1. 网页上的标准文本字段仅接受/显示纯文本。 当您将“Wingdings”字符添加到 Word 文档时,您实际上将该字符的字体更改为“Wingdings”。 这是可能的,因为大多数现代文本编辑器使用高级文档格式,如 RTF、ODF、各种 Word 格式之一等。

    因此,当您将选定的文本从 Word 复制并粘贴到浏览器时,所有文本格式(包括字体信息)都会丢失。 粘贴的文本将仅以字体和字体显示。 该特定文本字段的样式。

  2. 互联网上的大多数文档都使用某种形式的 Unicode 编码(通常是 UTF-8)进行编码。 由于 Wingdings 未映射到 Unicode,这导致它无法在网页上正确显示。

There are 2 problems here:

  1. The standard text field on a web page only accepts/displays plain text. When you add "Wingdings" characters to a Word document, you're actually changing the font for that character to "Wingdings." This is possible because most modern text editors use advanced document formats like RTF, ODF, one of the various Word formats, etc.

    So when you copy and paste a selection of text from Word to your browser, all the text formatting (including the font information) is lost. The pasted text will simply be shown in the font & style of that particular text field.

  2. Most documents on the internet are encoded using some form of Unicode encoding, typically UTF-8. Since Wingdings isn't mapped to Unicode, this prevents it from being displayed properly on web pages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文