PDA

View Full Version : Gibberish in Xcode




hmemcpy
Jun 3, 2011, 03:12 AM
Hey, new to programming...

When in XCode I'm running into a problem.

Window based App.

With classes folder selected I go to file/new / UIView / Objective-C class

But, both files that are created have only gibberish for text, as viewed in the coding section of Xcode. Also, if I drag and drop the newly created .h and .m files from the classes folder into a ASCII text editor, their fine, no gibberish.


Anyone seen this?


hem



forum user
Jun 3, 2011, 05:23 AM
Right click on file, Get info, check File Encoding
open shell and compare with output of file <name of file>

hmemcpy
Jun 3, 2011, 09:53 AM
Are you saying you think this could be a shell script?

It's not!, what i see on the screen is complete gibberish, not a script.

So I need to have web storage to show you all a pic? I don't have a web site, so how can I stick a pic up so you can see this gibberish?

Thanks,



hem

robbieduncan
Jun 3, 2011, 10:07 AM
So I need to have web storage to show you all a pic? I don't have a web site, so how can I stick a pic up so you can see this gibberish?

You can attach pictures to posts. MacRumors hosts them. Look in the Additional Options box when you reply: the Manage Attachments opens a new window that you can use to upload pictures. Take note of the max file sizes though...

hmemcpy
Jun 3, 2011, 11:50 AM
here is the gibberish....

Has anyone seen this?

wrldwzrd89
Jun 3, 2011, 11:56 AM
here is the gibberish....

Has anyone seen this?
That's an encoding problem for sure. The tip mentioned above using the file command in Terminal will help diagnose the cause.

chown33
Jun 3, 2011, 12:02 PM
That's an encoding problem for sure.

Skipping the inverted question marks, what's left looks like normal text. This suggests the inverted question marks are 0x00 bytes, which would be the high byte of a Unicode UTF-16-BE or UTF-16-LE encoding. The two other characters before the first / are probably the byte-order mark (BOM).

So somewhere or other, Xcode was probably told to use UTF-16.

hmemcpy
Jun 3, 2011, 12:27 PM
Thanks All, you guys were all over this!

The fix was Xcode/preferences/Text Editing/Default File Encoding:
was set to UTF - 16 I just set it to UTF -8 and BANG! was fixed.


Thanks again,



hem