How to write special character
I always got this error when i tried to write special characters directly into a label oder tableView: Error Domain=NSCocoaErrorDomain Code=261 UserInfo=0x616e160 "Operation could not be completed. (Cocoa error 261.)"
Now i solved this problem. I convert the char i need from the ASCII code width the javascript function: "String.fromCharCode(252)" and the error disappear. I hope this would help some of you guys ;)
4 Answers
-
Hi,
i got a similar issue, but i solved it with converting my files to UTF8.
So i can write ä,ö,ü,ß etc. without your String function ;)
-
Convert your file with aptana to utf8.
all files utf8: settings -> general -> workspace -> text file encoding
screenshotone file to utf8: right click on file -> properties -> text file encoding
-
How I convert the file to UTF8?
Thanks!
-
The function does help, because, if I'm trying to write in the UTF8-encoded file a character from Latin-1 Supplement UTF-8 table, it doesn't work in the application, whereas using String.fromCharCode works:
var lblDay2 = Titanium.UI.createLabel({ text:'Mar'+String.fromCharCode(355)+'i', ... });
Not working:
var lblDay2 = Titanium.UI.createLabel({ text:'Mar?i', ... });
I don't know why, maybe it's a bug :)