Cocos2D and UTF-8 (german characters) - encoding

I have a .xml file containing some text. The text also has some German charcters (ä, ü, ö) in it.
The XML file is encoded as UTF-8, wich makes it appear fine in every text editor and xcode.
But when showing the text on a Cocos2D CCLabelTTF (iPhone/iPad), the special characters get messed up. They are replaced by one or two ugly characters I have never seen before ;-)
Should I use a different encoding? Or is there a way to make Cocos2D get that right?
BTW: If I enter the same text directly into xcode (without using the xml file), the text shows up correctly on the label...

Related

PhpStorm editor encoding issue

I just have updated my PhpStorm to version 2016.1 and I have a really strange issue in editor, as you can see in the screenshot, some characters are screwed up.
When I copy/paste the text it is displayed correctly (the text before the require is "dojo"), I have tried changing the file encoding but without success (the file is UTF-8)
Someone already had this problem ? It is kind of annoying. See below my file encoding.
The problem don't seem to be the font (as suggested in comments) because italic is rendered:
It's not a problem with encoding .. but issue with your font. If you look at the screen -- only italic (or italic+bold) text has such problem.
How to check it:
If you select the text and copy-paste it into another editor (e.g. Notepad++ if you are on Windows) .. or even here into the actual Question -- will it copy that mangled text fine (I mean -- will it read "dojo" when pasted)?
Will it display it fine if you try another standard color schema -- e.g. "Default" or "Darcula"?
The issue can be with actual font (corrupted font files; somehow incomplete font data etc) .. or maybe even the with the way how IDE uses/renders it (e.g. font may not have separate "bold italic" style so IDE tries to mimic it and fails).
Either fix your font (re-download and reinstall; look for newer version maybe)
.. or use another font
.. or do not use italic (bold+italic) style

Chinese characters showing up as boxes in dreamweaver

When trying to copy paste some Chinese characters in a HTML file open in Dreamweaver I see that its being represented as boxes. When I view the pave on a browser I can see the characters correctly so its just in Dreameaver that they don't show up.
I read some posts on S.O. about utf-8 and saving with BOM disabled.I have even included Chinese on my keyboard with no luck.
edit. I tried editing the Fonts in Edit>Preferences to Chinese but when I click OK and I go back to it it shows Unicode again.
I could just copy and paste everything and it will work but it would be easier if I can see the different characters so when I need to hyperlink some word or include it in a tag I dont have to count boxes and view on the browser to figure it out.
I found out what was the problem. It was an encoding issue on Dreamweaver.
Went to Modify>Page Properties>Title/Encoding and changed the encoding to Chinese.
The Unicode showed up boxes in Dreamweaver.
However if you have already text copied in then they might not turn to the actual characters correctly so you have to re-enter them or if you didn't enter anything text yet its ok.

Unicode characters for «email», «save», «print»

I want to make a fallback for my icon font. For example, for my beautiful icon font check mark I use Unicode check mark equivalent:
.icon-checkmark {
&:before {
content: "\2713"; /* Unicode Character 'CHECK MARK' (U+2713) */
}
}
My icon font has character with code "\2713" also. If my icon font fails to load, user will see Unicode check mark; if icon font loads successfully, user will see icon font's beautiful check mark.
I'm searching for Unicode character equivalents for «email», «save» and «print» entities. Are there any or similar in Unicode tables? I have searched on http://www.fileformat.info/ but with no luck.
(I have found only an «email» character — http://www.fileformat.info/info/unicode/char/1f4e7/browsertest.htm, but it does not work in Chrome 28 (it works in all other browsers however :).
Here's some ideas. I have not tested them on any browsers except Firefox on Linux.
Email: ✉, Unlikely: 
Print: ⎙
Save: ↓, ▼
Edit: 💾 \U0001f4be could be used for saving since Unicode 6.x
I was also looking for save (floppy disk) symbol.
💾 symbol (mentioned in #Dark Falcon answer) is colored and not adjustable with its adjacent text colors.
I finally got 🖫 from graphemica.com
We can adjust it in any color by CSS color property.
🖫 white hard shell floppy disk for save (U+1F5AB)
✉ print screen symbol (U+2399)
⎙ envelope for email (U+2709)
Your question is actually two-fold: which Unicode code-points are useful for your purpose, and which Unicode code-points are covered with common font installations.
And it raises a new question: why do some programs (Chrome on Windows?) not show correct glyphs where other programs can?
Regarding the first two questions: as you can see, these days some really useful symbols just don't work on many systems out of the box.
Regarding the last question: I have no idea, but some insights on Linux:
Many programs (including Chrome) end up using fontconfig via one way or another. That library is responsible to find the fonts useful to display certain "text". At a higher level, the rendering is done with a mix of fonts, because for more challenging (web page) text there will always be a situation where one font won't cover everything there to display. Might the reason be that another style is requested or a code point is not covered.
So if Chrome on Linux does not show one thing or another, install fonts which have those glyphs (in a way that integrates well with fontconfig-configuration).
I have no idea what drives font-mixing on Windows.

iphone sdk Localizable.strings files displaying incorrecting in xcode 4.1 after upgrading

After upgrading to iphone xcode 4.1 build 4B110F all of my localizable.strings files are showing up as gibberish in the xcode editor. I created these files using UTF-16. I can not find a way to tell the editor that they are UTF-16. I am able to view the Localizable.strings files by viewing as a property list, but if I view them as Source Code, I see gibberish. I like to translate the entire localization.strings file and paste it into the editor. I don't want to have to cut and paste one line at a time in the property editor. There should be some way to tell xcode to show the file as UTF-16. Does anyone have any ideas?
I tried removing the files and re-adding them. I used to get prompted for the UTF type, but it does not do this any more.
You can find the text encoding setting for a file in the Utility area of Xcode 4.1. The utility area is the right-handside lateral area.
In the utility area, look for and select the first pane, named "File Inspector".
There, you will find the text encoding in the "Text Settings" block. Expand if necessary using the triangle.
I had this same problem. I was able to work around it (without much actual investigation) by simply opening the previous string files in TextWrangler, then copy from TextWrangler and paste into XCode4's view of the string file. Things seem to be working fine as a result.
To fix XCode 4.1 UTF-16 encoding issues:
1: Open the file you want to change
2: Put your cursor into the file, which will give the editor focus (VERY IMPORTANT).
3: Proceed to look under the Utilities Pane (very far right) for Text Settings and use the Text Encoding drop down to select UTF-16 or whatever other encoding you want.
If you forget step 2, and only highlight the file in the Project Navigator, you will not see encoding options.

How to change text encoding of Localizable.strings file in Xcode 4?

I am learning how to localize the strings in my project and I am using Xcode 4.
I have generated the base Localizable.strings file, and I want to import this file, changing its encoding from utf-16 to Unicode utf-16 so that the text in the file is readable within xCode. If I strate import this file, when I select it within xcode, the text shows up as gibberish.
In Xcode 3 when you drag the Localizable.strings into your project, the dialog box which appears gives you the option to change the text encoding, but this is not the case in Xcode 4.
Does anyone know a way around this?
Maybe this can help you Objective C/Xcode 4: Encoding Problem with Localizable.strings files
These kind of errors can happen if you copy and paste content within Xcode or from external files in your localization files. The consequence is that the encoding of the file changes to for example Western (Mac OS Roman). The Localizable.strings file should be in UTF-16 though.
Solution
1.
Like in the picture below, navigate in Xcode to the Localizable.strings location and open it so that you can see all the languages you are supporting.
Left-click on the language file the causes the build error.
Make sure your Utilities View is showing in Xcode. Activate on the button at mark 1 in Picture below.
In the Utilities View select the File Inspector. (Small Logo that looks like Page)
Under Text Settings change the encoding to UTF-16(Marked as 2 in the picture above). The Drop-Down might be grayed out but you can click on it anyways. Click on "Convert" on the Popup.
That's it your project should now compile again.
The "Text Settings" for my Localizable.strings files don't have the option of changing the encoding like XCode 3. However, I found if I simply restart Xcode 4, it reinterprets it correctly (UTF-16).
Sometimes Xcode displays the warning, even if the file contents are UTF-16, but the file is somehow interpreted as UTF-8. iconv usually says that it can’t convert the file in this case. Converting the file in Xcode to UTF-8 and then converting it back again to UTF-16, like Edmar suggested, solves this problem. The warnings are gone.
To make sure that nothing got broken during the conversion, recheck the whole strings file.
After changing the encoding, and re-executing the genstrings command to regenerate the localize string, things should work.
View -> Utilities -> Show File Inspector
Change Text Encoding in the file inspector utility view.