[clug] A plain text file that isn't, how do I convert it?

Paul Warren paul.warren at anu.edu.au
Fri Oct 31 04:20:05 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

jm wrote:

> 
> How about
> 
>  sed s/\223/\042/g
> 
> 
> as a last resort. I'm sure there's a smarter way. Does firefox or
> anything say anything about the encoding (Tools -> Page info)?
> 
> 
> Jeff.

Firefox reports that it's encoded as ISO-8859-1. Using:
recode iso-8859-1..ascii Congo.txt
recode: Congo.txt failed: Invalid input in step `ISO-8859-1..ANSI_X3.4-1968'

Peter Barker wrote:
> Try converting from windows-1252.  My guess is it won't work, but you
> could try :)
>
> recode CP1252..ascii < file > file.new

recode CP1252..ascii < Congo.txt >Congo-recode.txt
recode: Ambiguous output in step `CR-LF..data'


Will use tr for now, which is presenting it's own difficulties, but much
more readable so far.

And I apologise it was \227 instead of an emdash

Cheers
- --
Paul Warren
Specialist Programmer
ANUSF, Leonard Huxley Building Mills Rd Acton ACT 0200

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkKh3MACgkQbf5/PcytO2HurACgkZUP5zLffI4SaneP32N0KXdk
UnsAoKfMXMmYxNFcocXnvT3k00rKFL39
=rDpB
-----END PGP SIGNATURE-----


More information about the linux mailing list