lua-users home
lua-l archive

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


On Wed, Sep 22, 2010 at 2:32 PM, Fabien <fleutot+lua@gmail.com> wrote:
> luac.exe offers a "-o -" option to dump bytecode to stdout.
> Unfortunately, Windows considers stdout as an ASCII output, and therefore
> translates all occurrences of "0x0a" into "0x0d, 0x0a", thus corrupting the
> produced bytecode.
> This can be checked by performing a binary diff between 1.luac and 2.luac,
> produced by "luac -o 1.luac whatever.lua"  and "luac -o - whatever.lua >
> 2.luac".
This isn't so much a bug in Lua as it is a problem in Windows.  You
could work around this by forcing stdout to be binary _setmode... but
that's pretty ugly and platform specific.


-- 
Thomas Harning Jr.