Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 05-04-2012, 09:46 AM   #1
Lazybaer
Prospect
 
Join Date: Feb 2006
Posts: 20
Change Text File Encoding

Hi
How can I change the text file encoding to UTF-8 in lion on the command line? In snow leo it was as follows:
defaults write com.apple.textedit PlainTextEncoding -int 4
This does not work in lion anymore.
Any hint is welcome.
Thanks
Lazy
Lazybaer is offline   Reply With Quote
Old 05-04-2012, 11:52 AM   #2
chabig
Hall of Famer
 
Join Date: Jan 2002
Posts: 3,014
It works for me exactly as you described. I had no default set. I ran your defaults command, and verified that it worked. Why do you think it's not working?
chabig is offline   Reply With Quote
Old 05-04-2012, 12:26 PM   #3
Lazybaer
Prospect
 
Join Date: Feb 2006
Posts: 20
You are right. It works in the plist. I was mislead because in the TextEdit prefs it shows something different: plist value 30 = We-Mac, TextEdit Prefs UTF-8.
Still a problem in Lion - I think.
Lazybaer is offline   Reply With Quote
Old 05-04-2012, 12:41 PM   #4
chabig
Hall of Famer
 
Join Date: Jan 2002
Posts: 3,014
I too noticed that plist changes were not reflected in the GUI preferences.
chabig is offline   Reply With Quote
Old 05-04-2012, 01:15 PM   #5
benwiggy
League Commissioner
 
Join Date: Aug 2006
Location: London
Posts: 5,783
Quote:
Originally Posted by Lazybaer
Any hint is welcome.

If you're serious about editing text, then I would use TextWrangler as my default text app. Or other dedicated app in preference to TextEdit.

TW is free and I consider it an almost essential app for OS X.

I have seen some webpages using this command:
defaults write com.apple.textedit PlainTextEncodingForWrite -int 4

as well as the one you use.

Last edited by benwiggy; 05-04-2012 at 01:23 PM.
benwiggy is offline   Reply With Quote
Old 05-04-2012, 01:45 PM   #6
CopyCat
Prospect
 
Join Date: Feb 2012
Posts: 2
On snow leopard you can also do conversion with standard unix tool iconv...I'm not sure about Lion though. For the usage see the man page.
CopyCat is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.