# How can I handle box drawing characters?

I must generate files for windows batch scripting, modifying template files, es.

dataIn = Import["template.bat","Lines"];
dataOut = aFunction[dataIn];
Export["aScript.bat",dataOut,"Lines"];


The problem comes from the box drawing characters (see https://en.wikipedia.org/wiki/Box-drawing_character ) in template.bat, because they are never diplayed rightly.

I have tried:

test[dataIn_, encoding_] := Export[
encoding <> ".bat",
StringJoin @ FromCharacterCode[
ToCharacterCode[
Characters[dataIn]
], encoding
],
"Text"
];
dataIn = Import["template.bat", "Text"];
test[dataIn, #] & /@ $CharacterEncodings;  but none of generated files works. How can I handle them ? • As seen from StringJoin@FromCharacterCode[ToCharacterCode[Characters[dataIn]], #] & /@$CharacterEncodings, several of the encodings aren't able to represents the box-drawing symbols. I tried the code, and the generated files do look right, except those that aren't able to represent the box-drawing symbols. Are you saving your template.bat file as UTF-8? – WeavingBird1917 Jun 15 '19 at 3:05
• Hi ! No, I was working on template.bat saved as ANSI. But now I'm testing the UTF-8 options. What's the operating system on your computer ? – YoungStellarObject Jun 15 '19 at 20:29
• My operating system is Windows 10. I saved the template.bat as a UTF-8 file; box drawing symbols doesn't show if saved as ANSI. – WeavingBird1917 Jun 16 '19 at 2:16
• My operating system is Windows XP, I'm migrating to Windows 10. Now I have tried template.bat saved as "template - ansi.bat", "template - utf8 whitput BOM.bat", "template - utf8.bat" but box drawing characters never are seen correctly when runnig generated files. Would you receive the involved files? Can I send them here or should I use dropbox, or similar site? – YoungStellarObject Jun 16 '19 at 3:53