text encoding blues
Apr. 19th, 2006 02:42 pmBeating my head against the desk this week trying to figure out why, with the new mail agent, attached text files appear just fine in GUI editors as plain-text, but show up as one long line with interspersed EOL characters in vi.
Actually, I know *why* -- different formats -- but I don't know *which* format is which. I'm really trying to figure out how to Fixittm.
Saving as Unicode 16-bit doesn't do it. Unicode-8 bit is what it's in, now.
Right now I'm looking up how to search/replace CTRL characters w/in vi or using sed, in an attempt to end-run around the bloody agent.
Edited to add:
Found my kludge. Blech.
-----
1: ^M is actually the character sequence: CTRL+v, ENTER. The use of the pound (#) is arbitrary, it merely needs to be a unique sequence not otherwise present in the file.
Actually, I know *why* -- different formats -- but I don't know *which* format is which. I'm really trying to figure out how to Fixittm.
Saving as Unicode 16-bit doesn't do it. Unicode-8 bit is what it's in, now.
Right now I'm looking up how to search/replace CTRL characters w/in vi or using sed, in an attempt to end-run around the bloody agent.
Edited to add:
Found my kludge. Blech.
- save attachment from email.
- open attachment in vi,
s/^M/#/g1, and:wq - open attachment in TextWrangler, replace all instances of
#with\r, and save - re-open attachment in vi to confirm
-----
1: ^M is actually the character sequence: CTRL+v, ENTER. The use of the pound (#) is arbitrary, it merely needs to be a unique sequence not otherwise present in the file.