vanstyn / RapidApp

Turnkey ajaxy webapps
http://rapi.io
Other
48 stars 15 forks source link

UTF-8 display broken for markdown templates #192

Closed sammakkoinen closed 3 years ago

sammakkoinen commented 3 years ago

In a fresh installation of RapidApp v1.3302 (tested in Perlbrew with perl 5.24.4) I am able to create the default dashboard template dashboard.md via the web editor, as suggested. However, if the file's text contains UTF-8 chars, they display double-encoded. Nevertheless, in the editor form the display is correct, and the file itself is saved correctly. To reproduce, in the web editor add words like "coöperation, Æons" to the text of dashboard.md and save. The result is displayed as "coöperation, Æons".

So far I have noticed the removing this line: https://github.com/vanstyn/RapidApp/blob/585627c35cd6e530204a4bab73f69088f018fff5/lib/RapidApp/Template/Controller.pm#L550 fixes the issue, however I haven't checked for possible side effects thoroughly.

tehmoth commented 3 years ago

This also fixes the doubly encoded right angled quotes when editing pages in the RA infosite cms demo : https://github.com/IntelliTree/RA-InfoSite_cmsdemo the doubly encoded right angle quotes appear to have affected the http://www.rapidapp.info/ website, image

vanstyn commented 3 years ago

Thanks both of you for the feedback. I will make efforts to swing around to address this as soon as I can. I'm unfortunately very overcommitted at the moment. I know for a fact this worked properly before, so something else must have happened to cause this regression. If possible, if one of you could do a bisect to track down when this broke, that would be extremely helpful, and would speed up a fix getting shipped to CPAN. If the answer lies in changes to the CPAN stack (which is my gut) a bisect may not work. (or be prohibitively difficult.

This is an import issue and I will address it regardless. Thanks again very much

vanstyn commented 3 years ago

See the comment in the commit I just made which closed the issue. I've removed that line since regardless of the story that is something that shouldn't be happen, and it was a duct-taped hack probably anyway just looking at the comment. So I don't think this could be worse.

@sammakkoinen - this change will ship in the next CPAN release, please let me know if it solves your problem, and if not, re-open this

Something we still really need are test cases for template rendering.

vanstyn commented 3 years ago

shipped to CPAN in v1.3400

sammakkoinen commented 3 years ago

For the moment, everything has been working correctly with this version.