BrowserWorks / Waterfox-Classic

The Waterfox Classic repository, for legacy systems and customisation.
https://classic.waterfox.net
Mozilla Public License 2.0
176 stars 33 forks source link

using UTF-8 encoding on raw files(even when specified that they should do that). #63

Open decembre opened 2 years ago

decembre commented 2 years ago

What happened?

Waterfox Classic 2020.11 / 56.6

I tested on a new profile of Waterfox Classic, the install of an userstyle With Stylish (the last version without privacy pb) and without Stylus addon instaled. by example for this userstyle: Flickr WideScreen - BigONE Because Stylish don't handle the install and open its own addon page in Chrome Store (?), When i click on install button, it open a page https://userstyles.world/api/style/248.user.css

I copy paste the CSS in my Old Stylish editor, cut the to header: / ==UserStyle== ... / ... ==/UserStyle== /

The userstyles work, but strangely, it convert some Unicode, like that:

From: .context-slider-scrappy-view .context-slider > .nav-l span:before { content: " ◄" ; }

To this:

.context-slider-scrappy-view .context-slider > .nav-l span:before { content: " â—„" ; }

Can you enable UTF-8 encoding on raw files?

It's a duplicate of a report i make here: Unicode caracters wrong formated when i test install without Stylus WaterfoxCo/Waterfox#107 [Github Stylus] where dev said it's related to a bug in Waterfox.

Reproducible?

Version

G3.𝑋 (Current)

What platform are you seeing the problem on?

Windows

Relevant log output

No response

reallyuniquename commented 2 years ago

TL;DR: Not a Waterfox issue. Use View - Encoding - Unicode as a workaround.

There is no byte order mark in that CSS file, there is no @charset attribute in the sheet and that server doesn't specify an encoding in its HTTP headers. Waterfox falls back to your system's default encoding which is ANSI. It even explicitly tells you so The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range.

decembre commented 2 years ago

Not a Waterfox issue Thea's right: After a test with Stylus deactivated, Quantum do the same thing...

Thanks for the workaround:

Use View - Encoding - Unicode as a workaround.

I trying that before posting here, but i can't find a way to do it: Where i can change this setting? Edit after a re test more careful, i found how (I trying before with the contextual menu or in the Firefox options.):

Top menu > Affichage > Encodage du Texte > Unicode

Choose "Auto" is not enough. But it seems permanent . If permanent, no problem after for other type of views?

In an other side, it's difficult to know when it is useful to change this type. By example: .context-slider-scrappy-view .context-slider > .nav-l span:before { content: " ◄" ;

is located line ~ 15000... and it was only because i know the result, i can suppose a problem. Without that, i can, by mistake, copy paste the code CSS to publish it.

no @charset

But, in the stylus dev's reply,said:

(even when specified that they should do that)

The raw file as an ".user.css" in its url. So that's not enough? It's not possible to detect it and serve it with UTF-8 encoding ? Re edit: If Stylus disable, the view type is marked "Occidental" After Stylus enable, without reload the page, it is marked as "Unicode" Can use this type of detection for your own project?

in Changer ce que Firefox fait lorsque vous cliquez sur un fichier ou le téléchargez Mozilla recommend for these types of problems: Content-Type Fixer Tested: Can be installed but Not working effectively with Waterfox <57.... :-(

Anyway, thanks for the work on Waterfox Classic: It is so practical to have something working at the OLD way! And for sure, give the time to find how to pass the "superior" level without lost too many things and discover newer. ;-)

reallyuniquename commented 2 years ago

In an other side, it's difficult to know when it is useful to change this type.

You can always use File - Save As, open it in notepad and then copy paste it into old Stylish editor. That should work most of the time.

After Stylus enable, without reload the page, it is marked as "Unicode"

Maybe Stylus itself handles *.user.css and forces encoding to UTF-8.

It's not possible to detect it and serve it with UTF-8 encoding ?

It's possible to serve it with UTF-8 encoding header but that should be done by whoever owns userstyles.world, e.g. https://www.w3.org/International/questions/qa-css-charset#http

decembre commented 2 years ago

Thanks for your explanation. I had sent this request to userstyles.world before... Unicode caracters wrong formated when i test install without Stylus #107 [userstyles.world - GitHub] ;-) They suggest to address it to .... Waterfox. Finally, maybe with your idea can be done by them.

decembre commented 2 years ago

Good news: Fixed in userstyle.world: now no error UTF-8 encoding in the user.css.