2

I found error on Mojolicious Renderer when try to render © character (ascii: 169)

(also return error when try to render ascii larger than > 128)

Template "D:\sandbox\mojo\templates\BlueLeaves\index.html.ep" has invalid encoding. at D:/Perl64/site/lib/Mojolicious/Plugin/EPLRenderer.pm line 44.

I tried to use both:

no utf8;

and

use utf8;

But always return same error message

Do you know how to fix this problem ?

dns
  • 2,753
  • 1
  • 26
  • 33

2 Answers2

5

I solved this issue by changing the encoding of the template file to utf8 file in my IDE.

Check out this answer and save your file as utf8

Community
  • 1
  • 1
Tudor Constantin
  • 26,330
  • 7
  • 49
  • 72
3

Use UTF-8 encoding if possible -- that's always the best answer.

However if you really can't use UTF-8, you could replace the copyright symbol with it's HTML entity -- ©. That will render as the copyright symbol in the browser without you needing to actually send a UTF-8 character.

Preferable to use UTF-8 though if you can; it makes things a lot easier.

Spudley
  • 166,037
  • 39
  • 233
  • 307