Loading ...
Sorry, an error occurred while loading the content.

Text edit versus vi on some files

Expand Messages
  • Brian McKee
    ... Hash: SHA1 This should be reproducable on any Mac ... If I open that file in vim I get ??^@/^@*^@ ^@=^@=^@=^@=^@=^@ ^@F^@i^@l^@e^@n^@a^@m^@e^@s but Text
    Message 1 of 3 , Sep 18, 2006
    • 0 Attachment
      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      This should be reproducable on any Mac
      >
      > cd /Applications/iTunes.app/Contents/Resources/English.lproj
      > file Localizable.strings
      > Localizable.strings: Big-endian UTF-16 Unicode C program character
      > data

      If I open that file in vim I get
      ??^@/^@*^@ ^@=^@=^@=^@=^@=^@ ^@F^@i^@l^@e^@n^@a^@m^@e^@s
      but Text Edit displays it correctly.

      Can vi handle this type of file? If so, how?

      Since this seems to be related to the file type,
      can somebody point me at a 'Unicode for dummies' document?

      Pointers appreciated
      Brian

      PS I started on this road because of http://www.macosxhints.com/
      article.php?story=20060913032817384#comments
      trying to remove the all caps headings in iTunes 7
      -----BEGIN PGP SIGNATURE-----
      Version: GnuPG v1.4.1 (Darwin)

      iD8DBQFFDr1nGnOmb9xIQHQRAjrcAKDXMiIdv9EpQ3NveVkkDE+wTPlhYQCeJFgZ
      nKRnldKAOyAm6xze/FFI0Jc=
      =RgpU
      -----END PGP SIGNATURE-----
    • Chris Eidhof
      I ve got the following lines in my .vimrc: set encoding=utf8 set fileencoding=utf8 That works like a charm for me. Good luck,
      Message 2 of 3 , Sep 18, 2006
      • 0 Attachment
        I've got the following lines in my .vimrc:

        set encoding=utf8
        set fileencoding=utf8

        That works like a charm for me.

        Good luck,
        > Can vi handle this type of file? If so, how?
        >
        > Since this seems to be related to the file type,
        > can somebody point me at a 'Unicode for dummies' document?
      • Ned Konz
        ... Yes. If you have your fileencodings set right, it should just work. Try (in your .vimrc) set fileencodings=ucs-bom,utf-8,default,latin1 if you have
        Message 3 of 3 , Sep 20, 2006
        • 0 Attachment
          Brian McKee wrote:
          > -----BEGIN PGP SIGNED MESSAGE-----
          > Hash: SHA1
          >
          > This should be reproducable on any Mac
          >>
          >> cd /Applications/iTunes.app/Contents/Resources/English.lproj
          >> file Localizable.strings
          >> Localizable.strings: Big-endian UTF-16 Unicode C program character data
          >
          > If I open that file in vim I get
          > ??^@/^@*^@ ^@=^@=^@=^@=^@=^@ ^@F^@i^@l^@e^@n^@a^@m^@e^@s
          > but Text Edit displays it correctly.
          >
          > Can vi handle this type of file? If so, how?

          Yes. If you have your "fileencodings" set right, it should just work.

          Try (in your .vimrc)

          set fileencodings=ucs-bom,utf-8,default,latin1

          if you have ucs-bom,utf-8 at the beginning of fileencodings then the
          marker bytes that are at the beginning of the Unicode files will be used
          to decide on 'fileencoding'.

          --
          Ned Konz
          ned@...
          http://bike-nomad.com
        Your message has been successfully submitted and would be delivered to recipients shortly.