msctexen icon indicating copy to clipboard operation
msctexen copied to clipboard

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

Open Kochise opened this issue 4 years ago • 2 comments

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 avatar Sep 28 '20 17:09 Kochise

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 avatar Oct 01 '20 09:10 Kochise

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

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

Kochise avatar Oct 01 '20 09:10 Kochise