FransBouma / DocNet

Your friendly static documentation generator, using markdown files to build the content.
http://fransbouma.github.io/DocNet/
248 stars 36 forks source link

Russian language support #35

Closed Di-Roll closed 2 years ago

Di-Roll commented 8 years ago

Hi! DocNet is a great tool but I have problems with russian encoding. When I try to set russian text in footer I get - ????? And I cant search anything in russian (I use Firefox).

It would be great to have an option to turn on/off search.

FransBouma commented 8 years ago

DocNet is a great tool but I have problems with russian encoding. When I try to set russian text in footer I get - ?????

What's generated in the HTML? '????' ?

And I cant search anything in russian (I use Firefox).

Hmm. No idea what that is, might be the indexer in the javascript that only takes english, no idea.

Di-Roll commented 8 years ago

Here Are details of this issue. Russian text for footer from Docnet.json: "Footer" : "Водка Медведь Самовар", Result from index.htm: Р’РѕРґРєР° Медведь Самовар

Update I figured it out. In DocNet/src/DocNet/Config.cs file I ve changed line 44 from this: var configData = File.ReadAllText(configFile, Encoding.Default); to this: var configData = File.ReadAllText(configFile, Encoding.GetEncoding("utf-8"));

Now all is fine!

FransBouma commented 8 years ago

Interesting. Looking at the Encoding.Default help, https://msdn.microsoft.com/en-us/library/system.text.encoding.default(v=vs.110).aspx, this indeed isn't the proper way to do things.

Not sure if searching is fixed by that too, could you try?

FransBouma commented 8 years ago

I've added UTF-8 encoding to all file reads. It should now properly read the text / docs / config. Could you try the 0.12 source I just pushed? Thanks.

Di-Roll commented 8 years ago

Yes, now I get correct result with UTF-8 encoding. I got the same problem with searching (locally with Firefox browser) - No results found. I opened search_index.json and tried to search using keywords from file - same result.

FransBouma commented 8 years ago

Ok, just to clarify, the search now works too? Or is that still broken?

Di-Roll commented 8 years ago

Still broken... You could try to create local page with random russian text and check search function.

FransBouma commented 8 years ago

Ok, might be the javascript which does the search. As I pulled that from another lib, I have no idea where the bug is in there (or if that's fixable)

Di-Roll commented 8 years ago

I dont have any expirience with javascript yet, but I thinking to try http://www.tipue.com/ fo search.