good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Perl, DOS and encodingsby siberia-man (Friar) |
on Apr 29, 2020 at 17:53 UTC ( [id://11116231]=perlquestion: print w/replies, xml ) | Need Help?? |
siberia-man has asked for the wisdom of the Perl Monks concerning the following question: Hello dear Monks, I came with the issue I have encountered recently. I have the perl script git-md-toc helping me to generate Table of Content (TOC) from a markdown file and embed it into the original file. It worked fine with the Latin charset. Later I found it doesn't work with other encodings. I extedned it to support other encodings by specifying a particular encoding via an additional command line option. It works fine as well (I tested it under Cygwin). However it fails under DOS session, if there is need to add a title of TOC to the file written with non-Latin charset/encoding. For example, there is test file in UTF8 having some Cyrillic text. I need to update it adding TOC with the title in Russian. This command in bash works fine (Perl 5.30 shipped with Cygwin):
But it fails in DOS sessions -- the title is being added in wrong encoding. To resolve the issue I have to use one more option (standalone StrawberryPerl 5.30):
The thing confusing me is that the default DOS code page is 866 and the encoding for the title I have to specified is 1251. My questions are:
Back to
Seekers of Perl Wisdom
|
|