emoji

Why can't Emoji display correctly in a UITextField?

北城以北 提交于 2019-11-29 15:09:11
问题 When an Emoji character is set using the code below: self.textField.text = @"\ue415"; It just display as a square. But when I input an Emoji from the keyboard it displays correctly. What's the problem? PS: I'm using IOS 5.1 回答1: In older versions of iOS the Emoji characters were all in the Unicode Private Use Area, which as the name suggests is a set of Unicode code points that explicitly don't have any associated characters. However, the Unicode standard has been updated to include a large

how can I Deserialize emoji in json in C#

孤者浪人 提交于 2019-11-29 13:09:24
I have a json file that include emoji when I want to deserialize it , it could not deserialize emoji to string. my code is: var mystring ={"message":"jjasdajdasjdj laslla aasdasd ssdfdsf!!! 🙌\u{1F3FD}", "updated_time":"2015-04-14T22:37:13+0000", "id":"145193995506_148030368559"} FaceBookIdea ideaDetails = JsonConvert.DeserializeObject<FaceBookIdea>((mystring).ToString()); the error is : {"Input string was not in a correct format."} when I remove emoji it works well. Thank a lot for your help Your problem is that this portion of your message string does not conform to the JSON standard : "\u

Check if there is an emoji contained in a string

我只是一个虾纸丫 提交于 2019-11-29 12:36:21
问题 I am getting the text size of a string with this textSize = [[tempDict valueForKeyPath:@"caption.text"] sizeWithFont:[UIFont systemFontOfSize:12] constrainedToSize:CGSizeMake(280, CGFLOAT_MAX) lineBreakMode: NSLineBreakByWordWrapping]; The only problem I have is that if the string only contains an emoji, my app crashes. Is there an easy way to check for emojis or do I have to create an array with all possible emojis and then check for them using that? error: -[NSNull sizeWithFont

How can I search by emoji in MySQL using utf8mb4?

假装没事ソ 提交于 2019-11-29 12:25:27
问题 Please help me understand how multibyte characters like emoji's are handled in MySQL utf8mb4 fields. See below for a simple test SQL to illustrate the challenges. /* Clear Previous Test */ DROP TABLE IF EXISTS `emoji_test`; DROP TABLE IF EXISTS `emoji_test_with_unique_key`; /* Build Schema */ CREATE TABLE `emoji_test` ( `id` int(11) NOT NULL AUTO_INCREMENT, `string` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `status` tinyint(1) NOT NULL DEFAULT '1',

mysqldump with utf8 can not export the right emojis string

馋奶兔 提交于 2019-11-29 12:09:01
问题 I am using MySQL 5.5.29, utf8mb4 charset, there is a table user containing a field nickname with value hex F09F988EF09F988E that translates to the emojis 😎😎. Now open MySQL console, and execute: set names utf8mb4; select nickname, hex(nickname) from user; nickname | hex(nickname) ---------+----------------- 😎😎 | F09F988EF09F988E And then execute: mysqldump --default-character-set=utf8 -utest -ptest test_dev user > user.sql Check the user.sql and find the nickname display ?? which hex string

NSJSONSerialization and Emoji

百般思念 提交于 2019-11-29 11:53:27
I'm currently trying to POST some JSON containing emojis to a python API. I tried feeding the NSJSONSerialization directly with the string containing the emojis from my UITextField but the serializer crashed with no meaningful explanation. Afterwards I tried to do some format conversion and ended up with something like this: NSString *uniText = mytextField.text; NSData *msgData = [uniText dataUsingEncoding:NSNonLossyASCIIStringEncoding]; NSString *goodMsg = [[NSString alloc] initWithData:msgData encoding:NSUTF8StringEncoding] ; This basically works except that the resulting UTF-8 is kinda

How to check if a character is supported by a font

北慕城南 提交于 2019-11-29 11:39:23
I'm working on an app with a text field. The text wrote in this field will be printed and I have an issue with some characters like emoji, chinese characters, etc... because the font do not provide these characters. It's why I want to get all the character provided by a font (The font is downloaded so I can deal directly with the file or with an UIFont object). I heard about CTFontGetGlyphsForCharacters but I'm not sure that this function do what I want and I can't get it work. Here is my code : CTFontRef fontRef = CTFontCreateWithName((CFStringRef)font.fontName, font.pointSize, NULL);

不要小看小小的 emoji 表情

房东的猫 提交于 2019-11-29 09:29:39
前言 好久没更新了,最近事比较多,或许下个月就会恢复到正常的发文频次。 这篇文章得从一个 emoji 表情开始,我之前开源的一个 IM 项目中有朋友提到希望可以支持 emoji 表情传输。 https://github.com/crossoverJie/cim/issues/12 正好那段时间有空,加上这功能看着也比较简单准备把它实现了。 <!--more--> 但在真正实现时却发现没那么简单。 我首先尝试将一个 emoji 表情存入数据库看看: 果不其然的出错了,导致这个异常的原因是目前数据库所支持的编码中并不能存放 emoji ,那 emoji 表情到底是个什么东西呢。 本质上来说计算机所存储的信息都是二进制 01 , emoji 也不例外,只要存储和读取(编解码)的方式一致那就可以准确的展示这个信息。 更多编解码的内容后文再介绍,这里先想想如何快速解决问题。 存储 emoji 虽说想要在 MySQL 中存储 emoji 的方式也有好几种,比如可以升级存储字符集到可以存放 emoji ,但这种需要 MySQL 的版本支持。 所以更保险的方式还是在应用层解决,比如我们是否可以将 emoji 当做字符串存储,只是显示的时候要格式化为一个 emoji 表情,这样对于所有的数据库版本都可兼容。 于是我们这里的需求是一个 emoji 表情转换为字符串,同时还得将这个字符串转换为

不要小看小小的 emoji 表情

放肆的年华 提交于 2019-11-29 08:53:51
前言 好久没更新了,最近事比较多,或许下个月就会恢复到正常的发文频次。 这篇文章得从一个 emoji 表情开始,我之前开源的一个 IM 项目中有朋友提到希望可以支持 emoji 表情传输。 https://github.com/crossoverJie/cim/issues/12 正好那段时间有空,加上这功能看着也比较简单准备把它实现了。 <!--more--> 但在真正实现时却发现没那么简单。 我首先尝试将一个 emoji 表情存入数据库看看: 果不其然的出错了,导致这个异常的原因是目前数据库所支持的编码中并不能存放 emoji ,那 emoji 表情到底是个什么东西呢。 本质上来说计算机所存储的信息都是二进制 01 , emoji 也不例外,只要存储和读取(编解码)的方式一致那就可以准确的展示这个信息。 更多编解码的内容后文再介绍,这里先想想如何快速解决问题。 存储 emoji 虽说想要在 MySQL 中存储 emoji 的方式也有好几种,比如可以升级存储字符集到可以存放 emoji ,但这种需要 MySQL 的版本支持。 所以更保险的方式还是在应用层解决,比如我们是否可以将 emoji 当做字符串存储,只是显示的时候要格式化为一个 emoji 表情,这样对于所有的数据库版本都可兼容。 于是我们这里的需求是一个 emoji 表情转换为字符串,同时还得将这个字符串转换为

Why do emoji not render above a certain size in Chrome?

久未见 提交于 2019-11-29 08:07:06
问题 For some reason emoji do not render above a certain size in Chrome. This size seems unrelated to font-size or scale , it is just simply the pixel size of the emoji being rendered. Since the images are not vectors, I can understand the reasoning behind not wanting them to be abnormally large, however since this only effects Chrome I am unsure. Is this a Chrome bug, or something in the emoji standard that specifies a max intended size? Here are two examples of non-rendering emoji: http:/