unjello / msctexen

Mscgen in LaTeX
http://angelo.scene.pl
21 stars 6 forks source link

MSCGEN fails on accented characters (output file is ASCII instead of UTF8) #3

Open Kochise opened 3 years ago

Kochise commented 3 years ago

Hi, try this

msc { hscale = "2"; arcgradient = 8; a [label="Master"]; b [label="Slave"]; a->b: "Rampe accélération à 2000 tr/min/s"; b>>a: "Confirmation"; }

The accented characters from 'a->b' (accélération à) gets output into an ASCII file by '\immediate\openout' and makes MSCGEN crash.

Trying to integrate https://tex.stackexchange.com/questions/145343/encoding-of-written-out-files but failing to do so (not LaTeX specialist)

\VerbatimOut{\@outname.tmp}}

See attached file 'msctexen_utf8.txt'

msctexen_utf8.txt

Kochise commented 3 years ago

I think I nailed it thanks to https://tex.stackexchange.com/questions/149062/why-characters-utf-8-encoded-are-iso-8859-1-encoded-when-written-in-an-external

Dude, people are great...

Kochise commented 3 years ago

Another option to consider https://tex.stackexchange.com/questions/460913/immediate-write-with-plain-text

\begin{filecontents*}[overwrite]{tmp.txt}