Re: RS: RTF to unicode conversion
Re: RS: RTF to unicode conversion
- Subject: Re: RS: RTF to unicode conversion
- From: Ali Ozer <email@hidden>
- Date: Sun, 3 Jun 2007 15:22:30 -0700
To save plain text with TextEdit, you would open the RTF file, then
convert to plain text ("Make Plain Text" under "Format" menu), then
save, specifying any encoding you want. Or use textutil; in a
Terminal window:
textutil -convert txt -output outputfilename inputfilename
By default it will save plain text files as UTF8, but you can specify
other encodings as well.
Ali
On Jun 3, 2007, at 2:32 , Roland Silver wrote:
John Stiles,
My copy of (Tiger) TextEdit has only four options for output file
format: Rich Text Format (RTF), HTML, Word Format, and Word XML
format. None of these produces a simple Unicode file (eg UTF-8)
without a lot of metatext.
I HAVE found a way to convert from RTF to UTF-8, however. Using the
app AbiWord, I can input an RTF file (e.g. foo.rtf), and save it as
"Encoded Text" with any of a variety of encodings, including
"Unicode UTF-8".
A fragment of text from the result (foo_enc.txt) appears to be
valid UTF-8:
rollos$ od -tx /foo
0000000 69 64 65 73 e2 80 94 69 6c 6c 69 73 0a 000000
i d e s EM DASH i l l i s LF
U+2014
--Roland Silver
On Jun 3, 2007, at 12:07 PM, John Stiles wrote:
Have you tried TextEdit? That would be using all the Cocoa ways to
do it.
If it works in acceptable ways, it is open source: /Developer/
Examples/AppKit/TextEdit/
Roland Silver wrote:
Can anyone suggest how to convert a file from RTF format to Unicode?
If I read the file with MS Word and save it as "Unicode Text",
the result is not quite correct: The EM DASH character (U+2014)
is converted to HYPHEN-MINUS (U+002D).
Is there an available app to do the conversion?
If I have to write my own, is there some capability in Cocoa to
read an RTF-encoded file?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden