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):
git-md-toc -ut "some-text-in-russian" -Tutf8 "utf8-cyrillic.md"
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):
git-md-toc --title-transcode=cp1251 -ut "some-text-in-russian" -Tutf8 +"utf8-cyrillic.md"
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:
In reply to Perl, DOS and encodings by siberia-man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |