Gibberish in Xcode

Discussion in 'iPhone/iPad Programming' started by hmemcpy, Jun 3, 2011.

  1. hmemcpy, Jun 3, 2011
    Last edited: Jun 3, 2011

    macrumors newbie

    Joined:
    Jun 3, 2011
    #1
    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
     
  2. macrumors regular

    Joined:
    Aug 28, 2008
    #2
    Right click on file, Get info, check File Encoding
    open shell and compare with output of
    Code:
    file <name of file>
     
  3. thread starter macrumors newbie

    Joined:
    Jun 3, 2011
    #3
    hummm.....

    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
     
  4. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    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...
     
  5. thread starter macrumors newbie

    Joined:
    Jun 3, 2011
    #5
    pic

    here is the gibberish....

    Has anyone seen this?
     

    Attached Files:

  6. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #6
    That's an encoding problem for sure. The tip mentioned above using the file command in Terminal will help diagnose the cause.
     
  7. macrumors 603

    Joined:
    Aug 9, 2009
    #7
    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.
     
  8. thread starter macrumors newbie

    Joined:
    Jun 3, 2011
    #8
    Got it... FIXED

    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
     

Share This Page