Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encoding error with Japanese text using nanoc

I'm having trouble getting Japanese text to display properly on a website compiled using nanoc. I have the following markup in an HTML file, which is not going through any filters or layouts upon compilation:

<a class="push_button blue" href="./ja">
  日本語
</a>

and I saved the file with UTF-8 encoding and included <meta charset="utf-8"> in the head of the HTML document.

But the final markup produced by nanoc in the output folder is:

<a class="push_button blue" href="./ja">
  日本語
</a>

I'm not sure if this problem is specific to nanoc or if it's a general text encoding issue, but could someone suggest where this might be going wrong?

like image 493
Geoffrey Litt Avatar asked Nov 26 '25 14:11

Geoffrey Litt


1 Answers

I'm trying nanoc with Pali language and this helped me:

#lib/default.rb
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
like image 119
Pyro Avatar answered Nov 29 '25 03:11

Pyro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!