I am displaying emoji icons i my app, it was working fine when i was using as like in the below link
Replace Emoticons
But when stored the same unicode into db, it just displays as text "\ue058"
why this is happening, please help me out
The test you have in your question is different than the text in the answer to your other question
From the answer to your previous question:
myString = [NSString stringByReplacingOccurrencesOfString:#"sad" withString:#"\ue058"];
"/ue058" != "\ue058"
That may be your issue.
Without more information about how the string is being stored in the database and how it is being displayed that is my best guess.
Related
We're currently developing a game in Unity (2019.4.28f1). This game is played internationally. We'd like to add support for languages other than common Latin written languages. Currently, we're trying to implement support for Burmese, but aren't making much progress.
Finding fonts to display Burmese isn't a big issue. As you can see in the image below, we manage to display all characters that are supposed to be displayed.
However, the big problem here is that the displayed order of symbols isn't the same as what it's supposed to be (see image below for the desired result).
We've tried several fonts that use either Unicode or Zwagyi encoding, but none of them seem to display characters in the correct order. Currently, we're using a padauk font from here, which is supposedly Unicode encoded. Then, within Unity, we applied to following settings to that font:
So, if one of you knows more about this and can share some information with me, that would be much appreciated!
Thanks.
We've already found a solution for this! Before setting the text of the text component convert the Unicode codes to Zwagyi and it'll display the text in the correct order!
All the credits go to this guy who put in the effort to make a tool for these use cases!
Of course, you still need a (Unicode) font that supports these (Burmese) symbols.
Example:
Text textComponent = GetComponent<Text>();
textComponent.text = mmfont.Net.Converter.Uni2ZG(yourUnicodeText);
So I have 2 apps. One is a sensors app (built with XCode) that records data (text) with hardware wireless sensors. The other is a checklist/reference manual (built with Titaniam Appcelerator). Using custom URL schemes, they can instantiate each other.
What I am trying to do is paste any text data the sensors app copies to the clipboard into a text field in the reference manual app. I have a UIWebview showing html pages (the checklist) with a text box displayed now. To demo the capability, I have to touch the field and select paste. I was thinking that javascript might work, but all my research poo poo's that idea. Any thoughts about how to grab the text that is on the clipboard and display it programmatically in the reference manual app without having to touch the field and select paste?
Should I even be looking at the clipboard or should I be looking into modifying the custom URL scheme to pass data that way instead?
To get the text from the clipboard:
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSString *string = pasteboard.string;
if (string) {
// Do something
}
For more funcional communication between apps, take a look at URL Schemes.
So, I figured out a way to pass the data in the url with this tutorial. At the bottom it describes how to pass data after you set up the URL id for each app. Hope this helps someone.
Pasting in Swift
Get the pasteboard string with UIPasteboard.generalPasteboard().string.
The string is optional, so it must be unwrapped before being used.
if let pasteboardString = UIPasteboard.generalPasteboard().string {
// use the string, for example:
myTextView.insertText(pasteboardString)
}
Note
The original question is asking for something more complex than this. However, most people come here based on the question title rather than question content, so that I what I am answering here.
I have an app that retrieves a user's stream and puts it into a UITableView. However, some include emojis (those little smile faces in iOS), and they just return as boxes in my UILabel.
I've done some research, and I still can't figure it out. Does the text type need to be changed?
Thanks!
Please explain your problem better,from the piece that i understood,notice that emojis have native support in iPhone,so any app can display an emoji in a text box,i recommend you to check the methods you're using to add text to the uitableview and the text encoding from the string which is being displayed,also you could check this link
use NSString drawinrect to display emoji instead of drawGlyphsForGlyphRange.
I use a few special uniode chars in my app, but since iOS 5 these have been replaced with emoji characters. How can I force the unicode characters to be displayed and not the emoji characters? Thanks
This is an old question but it plagued me a lot recently until I found the answer.
Just add '\U0000FE0E' after the character that we want to prevent from becoming an emoji.
For example:
#"▶" // should be written as:
#"▶\U0000FE0E"
Using the escaped unicode works as well:
#"\u25B6" // should be written as:
#"\u25B6\U0000FE0E"
We need to use Unicode variants to prevent certain characters from becoming emoji.
Here is the article that solved my problem.
Just to add to BFerer's helpful answer, I found this works similarly in Swift:
"▶\u{0000FE0E}"
There's a few mentions of this issue on Apple's private devforums (which you have access to if you're a registered member of the iOS developer program).
It sounds like the potential solution would be to explicitly set the font for whatever you're trying to display.
Use "Hiragino Mincho ProN" for the font. It worked for me, but unfortunately I had to change the insets to make things look correct. I had to add an inset to the top to place things as they were before the iOS update.
All the credit goes to Kevin Ballard who answered my post in the following discussion -
Unicode characters being drawn differently in iOS5
I have a problem while localizing the application name. The problem appears when I put an special char on a localized CFBundleDisplayName attribute.
The default name is:
"CFBundleDisplayName" = "seguridad";
And the translation to portuguese:
"CFBundleDisplayName" = "Segurança";
With this configuration, the device always show the default name ("seguridad"). But when I replace the portuguese string with:
"CFBundleDisplayName" = "Seguransa";
the localized string is shown correctly.
Any help will be apreciated.
Thanks in advance.
Ok, I've found the problem. Don't know why, but the file had an incorrect encoding (I've created it using xcode). Just changed file encoding and everything works fine now.
Thanks for the responses.
When you say "the device always show" I assume you mean on the Icon?
I seem to be able to add a 'ç' to my CFBundleDisplayName just fine. As well as any other unicode characters.
I know that when you change the 'Product Name' in your Target then you have to close & reopen your project before it'll fully take effect (daft, I know). Maybe give that a try?