think tank forum

technology » Character Encoding

DaGr8Gatzby's avatar
15 years ago
link
DaGr8Gatzby
Drunk by Myself
I can only assume OS X encodes all my files in UTF-8. Pasting UTF-8 characters works in Terminal.app. I can't ask for anything better. However, since I do share code across machines, I was wondering if there was a command I could use to determine the character encoding of a file. Oh and file on a linux/BSD machine DOES NOT WORK! At least not for me.

DaGr8Gatzby's avatar
15 years ago
link
DaGr8Gatzby
Drunk by Myself
$ man find

Search for mime. Get the switch.

OS X:

MacBook:Ruby dontiveros$ file -I random.rb
random.rb: text/plain; charset=us-ascii
asemisldkfj's avatar
15 years ago
link
asemisldkfj
the law is no protection
yay
DaGr8Gatzby's avatar
15 years ago
link
DaGr8Gatzby
Drunk by Myself
That doesn't work. *sigh*
Carpetsmoker's avatar
15 years ago
link
Carpetsmoker
Martin
http://opal.com/jr/freebsd/unicode/utf8demo.txt