[JW Lua] FCString:AppendEOL appends 0d 0d 0a on Windows ... more
Jan Angermüller
jan at angermueller.com
Wed Jul 22 19:10:43 CEST 2015
Hm, it seems more difficult than that:
If I use local outfile = io.open("c:\\test.txt", "w*b*") (=binary file)
instead, the EOL output is fine: 0d 0a.
If I use local outfile = io.open("c:\\test.txt", "w"), the EOL output
is: 0d 0d 0a.
If I remove text:AppendEOL(), the end of the file is empty (no 0d at all
!) no matter whether I use "wb" or "w".
So maybe that's the typical Lua behaviour and I should use a binary file
with "wb" although the result will be a text file.
Jan
-------- Weitergeleitete Nachricht --------
Betreff: [JW Lua] FCString:AppendEOL appends 0d 0d 0a on Windows
Datum: Wed, 22 Jul 2015 19:00:03 +0200
Von: Jan Angermüller <jan at angermueller.com>
Antwort an: The JW Lua script plug-in. <jwlua at jwmusic.nu>
An: The JW Lua script plug-in. <jwlua at jwmusic.nu>
Jari,
FCString:AppendEOL() appends a "0d 0d 0a" instead of the typical "0d 0a"
on Windows.
Code snippet below.
All the best,
Jan
local text=finale.FCString()
text.LuaString="Test"
text:AppendEOL()
local outfile = io.open("c:\\test.txt", "w")
outfile:write(text.LuaString)
outfile:close()
The created file then has the following hex codes:
54 65 73 74 0D 0D 0A
(54 65 73 74 =="Test")
_______________________________________________
JWLua mailing list
JWLua at jwmusic.nu
http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20150722/82c5ac36/attachment-0002.html>
More information about the JWLua
mailing list