Loading... |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
Hi all,
rendering a text with Asciidoctor, I alway get this error - only when using german sepcial characters (äöüßÄÜÖ). If I don't use german special characters (or html-entities), all works fine. Windows 7 / 64-Bit CompatibilityError: incompatible character encodings: CP850 and UTF-8 On rendering with asciidoc - all works fine. Any Ideas? thanks, Manfred |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
Manfred, Long story short, Asciidoctor was properly handling non-Ascii characters *if* the system encoding was set to UTF-8. When the system encoding was changed to something other than UTF-8 (such as US-ASCII or CP850), Asciidoctor was unable to handle a string containing a UTF-8 character because Ruby would complain the encodings are incompatible.Thank you for reporting this issue. A similar issue was reported this morning. I decided to take action on it. I've since applied a fix (which is pending review). https://github.com/asciidoctor/asciidoctor/issues/308 If fixed this problem by forcing the encoding for any input data to UTF-8 if the system encoding is something other than UTF-8. I've also made the tests around string encoding even more rigorous, so if a bug appears, the tests will fail spectacularly. In the meantime, the workaround is to use the -E flag to explicitly set the default encoding when running Ruby. ruby -E UTF-8 my_script.rb This is the recommended practice for running Ruby in production. When the default encoding is set to UTF-8, non of the force encoding code will be used. Hope that helps! or or On Tue, Apr 30, 2013 at 8:49 AM, mbw [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi all, ... [show rest of quote] -- Dan Allen Principal Software Engineer, Red Hat | Author of Seam in ActionRegistered Linux User #231597 |
Loading... |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
Hi Dan,
thank's for your quick help! I changed the asciidoctor.bat - Start-Script and it works! (Windows7 64 Bit,German) Manfred echo asciidoctor @ECHO OFF IF NOT "%~f0" == "~f0" GOTO :WinNT echo start @"ruby.exe" "C:/SOFTWARE/Ruby200-x64/bin/asciidoctor" %1 %2 %3 %4 %5 %6 %7 %8 %9 GOTO :EOF :WinNT @"ruby.exe" -E UTF-8 "%~dpn0" %* |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
Great! I've also merged in support to Asciidoctor to handle this gracefully if the system encoding happens to be something other than UTF-8. https://github.com/asciidoctor/asciidoctor/pull/310 Enjoy the writing! -Dan On Thu, May 2, 2013 at 1:08 AM, mbw [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi Dan, ... [show rest of quote] -- Dan Allen Principal Software Engineer, Red Hat | Author of Seam in ActionRegistered Linux User #231597 |
Free forum by Nabble | Edit this page |