lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Oct 08, 2008 at 06:37:24AM -0400, Brian Sanders wrote:
> Looking at this fine in a hex editor, I see some interesting stuff.  The
> file starts with FF EE, then begins with the standard characters.  Between
Hmm, this should be FF EE, making it UTF-16 or UCS-2 with BOM.
http://en.wikipedia.org/wiki/UTF-16/UCS-2

FF FE is the byte order mark, telling you it's little endian
(lower byte first, the Unicode value of the BOM is U+FEFF),
which comes as no surprise on a Wintel box..

> every character is 00, which in the other window translates to just a
> square.  It appears that these 00's are every other character in the file.
> FF EE 58 00 30 00
> ??  ??  [   ??  0  ??
> 
> So every other character from then on is expected and is what I see in the
> file.  I just don't know the starting, or the 00 every other character.

As long as the actual character values are in Latin 1,
the high byte (every other) is always 0 and you can simply ignore it,
and discard the two bytes BOM (sure you have FF EE?).


HTH
Klaus