[tex-live] TeXLive (Windows) bash script -> exe

Josef Kleber josef.kleber at gmx.de
Wed May 21 18:31:18 CEST 2014


Hi

Am 21.05.2014 11:11, schrieb Norbert Preining:
>> I have added a function url_encode, found in
>>    http://lua-users.org/wiki/StringRecipes
>> and wrapped the user data in url_encode.
>> Then http.request worked for me, see attached script.
>
> Thanks Heiko.
>
> I have replaced the getopt function with my own argument
> parsing routine (actually the one I wrote in 2008 for
> TeX Live when I thought I rewrite the whole perl scripts in
> texlua ;-)))))
>
> Attached osmimage3.lua
>
> Josef, you might try that out and see if you like it.

Okay, i can confirm that osmimage4.lua (Heiko) does almost work! ;-)

Two little problems left:

1) I had to change check_range

function check_range(var,min,max,exitcode,varname)
   check_number(var,varname)
   if (tonumber(var) < tonumber(min) or tonumber(var) > tonumber(max)) then
     osmimage_error(exitcode, varname .. " = " .. var .. "; must be in 
the range of " .. min .. "-" .. max)
   end
end

comparing string with number error

2) Calling Windows' texlua brings up an encoding problem ansi -> utf8
    texlua osmimage.lua -l "Bergheimer Straße 110A, 69115 Heidelberg, 
Germany"                              ^^^^^^

Fortunately, this problem is also solved with Heiko's answer here to 
encode \write18 calls as utf8:
http://tex.stackexchange.com/questions/178883/write18-encoding

===> Mission accomplished

I want to thank Norbert for converting the bash script to lua and of 
course all the others for their valuable input!

As well as turning this longish thread into my personal lua tutorial! ;-)

Josef





More information about the tex-live mailing list