特殊字符(表情符号)在文本文件 [英] special characters (emoticons) in text file

查看:966
本文介绍了特殊字符(表情符号)在文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从WhatsApp导出的对话的txt文件。 WhatsApp在他们的谈话支持表情符号,并且导出的对话,也令我惊讶的是,包含这些表情符号!也就是说,如果我在文本编辑器中打开文本文件(Mac 10.8上的文本驱动器),我可以看到表情符号。文本文件以UTF-8编码,没有与我可以告诉的文件相关联的资源。

I have a txt file of an conversation exported from WhatsApp. WhatsApp supports emoticons in their conversation, and the exported conversation also, to my surprise, contains these emoticons! That is, if I open the text file in a text editor (Text Wrangler on Mac 10.8) I can see the emoticons. The text file is encoded in UTF-8 and there are no resources associated with the file that I can tell.

任何人都可以向我解释这些表情符号是如何包含在文本文件以及它们如何被文本编辑器准确地解释?这是否与字符编码有关?文本文件中是否包含额外的资源?

Can anyone explain to me how these emoticons are being included in the text file and how they are accurately being interpreted by the Text Editor? Is this related to the character encoding at all? Are extra resources included with the text file?

推荐答案

Unicode包含将表情符号指定为字符的部分。他们是常规字符,你只需要一个字体,可以显示它们。另请参阅 Unicode表情符号常见问题

Unicode contains sections which specify emoji as "characters". They're regular characters, you only need a font which can display them. Also see the Unicode Emoji FAQ.

在文本文件中,字符基本上以字节形式编码为数字。要在计算机屏幕上直观地显示这些字符,您需要一个包含视觉字形字体来呈现此字符。由于该过程总是数字标识符→字体→可见字形,应该很明显,一个字符可以是任何视觉,包括表情符号或任何其他图像。

In a text file, characters are basically encoded as numbers in the form of bytes. To display those visually on a computer screen you need a font which contains the visual glyph to render this character. Since the process is always numeric identifier → font → visible glyph, it should be pretty obvious that a "character" can be anything visual, including emoji or any other image.

这篇关于特殊字符(表情符号)在文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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