sgn icon indicating copy to clipboard operation
sgn copied to clipboard

Can't display other language correctly

Open huiyn opened this issue 2 years ago • 2 comments

Expected Behavior

I am localizing the website to Chinese, most of the pages work fine like below.

Screen Shot 2022-08-29 at 15 30 35

For Bugs:

But some pages are garbled

Screen Shot 2022-08-29 at 15 32 08

This only happens when the URL ends with a .pl file Screen Shot 2022-08-29 at 15 44 39

English all works fine, only Chinese on the page is garbled.

After some search, I think this is something about code in cgi-bin folder, I tried to add "use utf8;" in some files but not working. I don't know if I am correct, but I think all the .pl files are code from the old mod_perl project, and mod_perl doesn't support utf8 well.

Any ideas on how to solve this issue?

Environment

Steps to Reproduce

huiyn avatar Aug 29 '22 07:08 huiyn

Hi, thanks for the amazing work to translate to Chinese!

We should have replaced all of these pages by now, but it didn't quite happen 100%. For the about page, I think there is an alternate mason page as well that you should probably link to. How many pages have you seen that are still around that are based on the old mod perl? They are usually simple pages that can be replaced easily with mason pages.

lukasmueller avatar Aug 29 '22 13:08 lukasmueller

For the display in the cgi-bin files, the problem may occur because most of the content is read in from files. The filehandles need to be opened as utf-8 encoded filehandles, such as open(my $F, "< :encoding(UTF8)", $filename) ...

lukasmueller avatar Aug 29 '22 13:08 lukasmueller

Hi Huiyn, if that suggestion didn't work let me know, otherwise I will close this ticket. Thanks again for letting us know.

cheers Lukas

lukasmueller avatar Sep 12 '22 14:09 lukasmueller