Kodi Community Forum

Full Version: UTF-8 vs. UTF-8-MAC support in XBMC for Mac OS X?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello..
I did not understand why Russian letter 'Й' ('I shortly' or [ij]) displayed as 'И' and square, when I see file list in XBMC .. I found this..
From wikipedia : "The Mac OS X Operating System uses canonically decomposed Unicode, encoded using UTF-8 for file names in the filesystem. This is sometimes referred to as UTF-8-MAC. In canonically decomposed Unicode, the use of precomposed characters is forbidden and combining diacritics must be used to replace them."
And link http://developer.apple.com/qa/qa2001/qa1173.html


How to solve this problem described here http://developer.apple.com/qa/qa2001/qa1235.html

If you wish I can make patch.. Smile
Have you tried the latest version? I experienced myself a similar issue before, where the Swedish letter Ä would be displayed like A and the two dots beside it, not above.
0.5.0b2 Fix this !
One thing to watch here:

We use UTF8 inside our XML files (smartplaylists for instance, plus many more) which may or may not be UTF8-MAC.

It won't matter if they're written by XBMC (as I presume they're written in UTF8-MAC) but it might make a difference for some of the stuff not written from XBMC, such as strings.xml and so on.

Cheers,
Jonathan
UTF8-MAC only used for encoding filename in VFS (OS X file system API)!!!!

"In Mac OS X's VFS API file names are, by definition, canonically decomposed Unicode, encoded using UTF-8" from http://developer.apple.com/qa/qa2001/qa1173.html .

In another cases everything must be ok.
A grep through the source indicates UTF8-MAC is being used in all utf8 -> wchar conversions, which is happened whenever something is displayed in the UI, as we store all strings internally as utf8.

From my understanding, it appears we only want to use UTF8-MAC to be used when we are grabbing filenames from the osx API. Thus, we actually want to do a UTF8-MAC -> UTF8 conversion at that point, and leave everything else in normal UTF8.

I'll mail elan and let him know in case he doesn't see it here.

Cheers,
Jonathan
Yes, you are right. Simply, I did not see last sources. Smile
Have chatted with Elan, and he's informed me that UTF8-MAC takes care of both cases, so things should be rosy with the current setup Smile
What about folder names in OS X? It seems to me that folder names are in decomposed Unicode while filenames are in precomposed form: diacritics are misadjusted (or don't display at all eg. "ö" -> "o ", depending on the specific GUI font) in folder names when they look perfect in filenames.

Is there any simple solution to this issue?

Thx
file a trac ticket with info on how to reproduce the error and this will be addressed.
@adinatha

Have you checked recent build of XBMC?
there was a fix for decomposed unicode. http://trac.xbmc.org/ticket/5658