German Characters
aschi2403 opened this issue · 3 comments
There seems to be a problem with german characters.
I think they don't get parsed how they should be, because if I write them directly in an ASP.NET Core Web Razor Page they are displayed correctly in the browser.
When I write them in the Markdown file they are shown as random characters like in the screenshot attached.
I would really appreciate if you could fix that, or tell me if I did something wrong in which case I'm sorry I created a Github issue for that.
Most likely that's an encoding problem. Make sure that the file is UTF-8 encoded. Otherwise you need to use the low level functions and specify the encoding to use.
Checked in the sample:
<div class="sample-block">
<markdown Filename="~/MarkdownPartialPage.md"></markdown>
</div>
then add:
# Inhalt
Überschrift
Run it and:
Thanks for you answer, it really was an Encoding problem.
For some reason when I opened the Markdown file in Visual Studio Code it showed UTF-8 but showed them the same way as the Web App.
Recreating them with Visual Studio Code somehow solved the problem.
Thanks for you help
I'm guessing the file wasn't actually saved with the encoding byte marks. I can't remember the proper sequence there, but if you use Visual Studio or VS Code with UTF-8 encoding on the file it should work. Certainly did when I tested and saved the sample file (in VS 2019).
I think one of the issues could be UTF-8 with a BOM or without. The default tends to be with a BOM (ie a few bytes of preamble before the doc starts). You can control this if you use the Markdown.File() helper where you can specify the encoding if necessary (but then knowing what that is is very difficult).
File encoding can be a pain - that's why at this point I think there's NEVER a reason not to save a file in UTF-8 format.