# [tex-live] Lua module 'socket.url' loading problem with getmap

Josef Kleber josef.kleber at gmx.de
Fri Jul 13 12:33:19 CEST 2018

Dear Akira

Am 11.07.2018 um 12:04 schrieb Akira Kakuto:
> Dear Josef,
>
>> Dear Akira, weirdness lives on! ;-)
>
> My experimental consequence:
>
> (1) In the case of pdflatex:
>
> If the encoding is UTF-8, command like
> \usepackage[utf8]{inputenc}
> is not necessary.
> In the other cases, command like
> \usepackage[cp1252]{inputenc}
> is necessary. Otherwise, URLs are broken and
> correct maps are not obtained for non-ascii names.

Agreed

> (2) In the case of xelatex and lualatex, use 'UTF-8' encoding only!!.

That's where my problem starts. If I use exactly the example in your
last email and save it in utf8 and it is utf8

$file bug_getmap_2.tex bug_getmap_2.tex: LaTeX 2e document, UTF-8 Unicode text, with CRLF line terminators$ hexdump -C bug_getmap_2.tex
00000000  5c 64 6f 63 75 6d 65 6e  74 63 6c 61 73 73 7b 61
|\documentclass{a|
00000010  72 74 69 63 6c 65 7d 0d  0a 5c 75 73 65 70 61 63
|rticle}..\usepac|
00000020  6b 61 67 65 7b 67 72 61  70 68 69 63 78 7d 0d 0a
|kage{graphicx}..|
00000030  5c 75 73 65 70 61 63 6b  61 67 65 5b 6f 76 65 72
|\usepackage[over|
00000040  77 72 69 74 65 3d 74 72  75 65 5d 7b 67 65 74 6d
|write=true]{getm|
00000050  61 70 7d 0d 0a 5c 62 65  67 69 6e 7b 64 6f 63 75
|ap}..\begin{docu|
00000060  6d 65 6e 74 7d 0d 0a 5c  67 65 74 6d 61 70 5b 6d
|ment}..\getmap[m|
00000070  6f 64 65 3d 67 6d 5d 7b  42 65 72 67 68 65 69 6d
|ode=gm]{Bergheim|
00000080  65 72 20 53 74 72 61 *c3  9f* 65 20 31 31 30 41 2c  |er
Stra..e 110A,|  *<--------*
00000090  20 36 39 31 31 35 20 48  65 69 64 65 6c 62 65 72  | 69115
Heidelber|
000000a0  67 2c 20 47 65 72 6d 61  6e 79 7d 0d 0a 25 5c 67  |g,
Germany}..%\g|
000000b0  65 74 6d 61 70 5b 6d 6f  64 65 3d 67 6d 5d 7b 42
|etmap[mode=gm]{B|
000000c0  65 72 67 68 65 69 6d 65  72 20 53 74 72 61 73 73  |ergheimer
Strass|
000000d0  65 20 31 31 30 61 2c 20  36 39 31 31 35 20 48 65  |e 110a,
69115 He|
000000e0  69 64 65 6c 62 65 72 67  2c 20 47 65 72 6d 61 6e  |idelberg,
German|
000000f0  79 7d 0d 0a 5c 69 6e 63  6c 75 64 65 67 72 61 70
|y}..\includegrap|
00000100  68 69 63 73 5b 77 69 64  74 68 3d 31 30 63 6d 5d
|hics[width=10cm]|
00000110  7b 67 65 74 6d 61 70 7d  0d 0a 0d 0a 5c 67 65 74
|{getmap}....\get|
00000120  6d 61 70 5b 66 69 6c 65  3d 62 65 72 6c 69 6e 2c
|map[file=berlin,|
00000130  20 6d 6f 64 65 3d 67 6d  5d 7b 42 72 61 6e 64 65  |
mode=gm]{Brande|
00000140  6e 62 75 72 67 65 72 20  54 6f 72 2c 20 42 65 72  |nburger
Tor, Ber|
00000150  6c 69 6e 7d 0d 0a 5c 69  6e 63 6c 75 64 65 67 72
|lin}..\includegr|
00000160  61 70 68 69 63 73 5b 77  69 64 74 68 3d 31 30 63
|aphics[width=10c|
00000170  6d 5d 7b 62 65 72 6c 69  6e 7d 0d 0a 0d 0a 25 5c
|m]{berlin}....%\|
00000180  67 65 74 6d 61 70 5b 66  69 6c 65 3d 6d 75 63 2c
|getmap[file=muc,|
00000190  20 6d 6f 64 65 3d 67 6d  5d 7b 53 74 61 63 68 75  |
mode=gm]{Stachu|
000001a0  73 2c 20 4d 75 65 6e 63  68 65 6e 7d 0d 0a 5c 67  |s,
Muenchen}..\g|
000001b0  65 74 6d 61 70 5b 66 69  6c 65 3d 6d 75 63 2c 20
|etmap[file=muc, |
000001c0  6d 6f 64 65 3d 67 6d 5d  7b 53 74 61 63 68 75 73
|mode=gm]{Stachus|
000001d0  2c 20 4d c3 bc 6e 63 68  65 6e 7d 0d 0a 5c 69 6e  |,
M..nchen}..\in|
000001e0  63 6c 75 64 65 67 72 61  70 68 69 63 73 5b 77 69
|cludegraphics[wi|
000001f0  64 74 68 3d 31 30 63 6d  5d 7b 6d 75 63 7d 0d 0a
|dth=10cm]{muc}..|
00000200  5c 65 6e 64 7b 64 6f 63  75 6d 65 6e 74 7d        |\end{document}|
0000020e

Even in the hexdump you can clearly see that 'ß' is correctly encoded as
c3 9f

If I compile this file with pdflatex everything is fine.

getmapdl.lua:
url =
url length = 307 bytes
output = getmap.png

ß: c3 9f

But lualatex -shell-escape file (the very same utf8 file) produces:

! error:  (file getmap.png) (pdf backend): internal error: unknown image
type
!  ==> Fatal error occurred, no output PDF file produced!

> lualatex result for UTF-8 encoding case:
>
> url =
>
> url length = 307 bytes

url =
url length = 307 bytes

because 'ß' is encoded c3 3f instead of c3 9f.

This could be some strange weirdness on my system. I de- and reinstalled
both luatex and getmap without any change. I'm puzzled and don't know
what I still can do.

Can please somebody else test the following file on his/her system with:
lualatex -shell-escape file

%
% encoding is UTF-8
%
\documentclass{article}
\usepackage{graphicx}
\usepackage[overwrite=true]{getmap}
\begin{document}
\getmap[mode=gm]{Bergheimer Straße 110A, 69115 Heidelberg, Germany}
%\getmap[mode=gm]{Bergheimer Strasse 110a, 69115 Heidelberg, Germany}
\includegraphics[width=10cm]{getmap}

\getmap[file=berlin, mode=gm]{Brandenburger Tor, Berlin}
\includegraphics[width=10cm]{berlin}

%\getmap[file=muc, mode=gm]{Stachus, Muenchen}
\getmap[file=muc, mode=gm]{Stachus, München}
\includegraphics[width=10cm]{muc}
\end{document}

This was from the very beginning a Windows only problem, right? Can
someone with a Linux system do the test, too?

Best,

Josef