How do I log russian text or non-latin?

坚强是说给别人听的谎言 提交于 2019-12-06 15:03:54

Works fine for me in Xcode 4.2, so it's either a 4.3.2 bug or your source file encoding is wrong.

Check the "Preferences / Text Editing / Editing tab / Default text encoding" setting and make sure it's set to Unicode (UTF-8).

If it is, open the file in BBEdit and double check its encoding. It's possible there's an old MacRoman or other encoding set on the file.

Update:

Works fine in Simulator for me.

However on a real device running iOS 5.1 I am getting the same wrong, disturbed output as you. So it probably is an XCode 4.3.2 bug.


I tested your code on XCode 4.3.2 and it works fine for me.

My logs:

2012-04-15 15:44:28.545 test[25799:15203] russian text: русский текст
2012-04-15 15:44:28.548 test[25799:15203] ___text: russian text: русский текст

I found a solution. You need to change debugger from LLDB to GDB in Product->Edit Sheme. LLDB doesn't work correctly with russian language.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!