[oclug] unicode? file

Adrian Irving-Beer wisq-oclug at wisq.net
Tue Feb 22 09:59:23 EST 2005


On Tue, Feb 22, 2005 at 08:47:38AM -0500, Stephen M. Webb wrote:

> > ^@T^@h^@i^@s^@ ^@i^@s^@ ^@a^@ ^@b^@o^@o^@k^@ ^@y^@o^@u^@'^@r^@e^
> > etc etc
>
> Nope, it's not any of the Unicodes.  None of them allow embedded
> single-byte nulls in a valid sequence.

Whatever the theory (I don't know enough about Unicode), I can get
this effect by taking an ordinary file and doing

        :w ++ff=utf16

in vim and then trying to open it again.

'utf16' appears to be an alias for 'ucs2be'.  Similarly, iconv
believes this to be 'UTF16BE'.

Hence, you can try the s/^@//g approach, or you can do

        iconv -f utf16be -t iso8859-1 infile > outfile

Assuming it really is UTF16BE, which is my best guess at this time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://tux.oclug.on.ca/pipermail/oclug/attachments/20050222/f0f97d30/attachment.bin


More information about the OCLUG mailing list