Funkcjonalność tej witryny będzie ograniczona w czasie konserwacji. Jeśli artykuł nie rozwiązuje twojego problemu i chcesz zadać pytanie, to nasza społeczność wsparcia jest dostępna na @FirefoxSupport na Twitterze i /r/firefox na Reddicie.

Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Więcej informacji

Cached text/plain document has wrong encoding

  • 4 odpowiedzi
  • 1 osoba ma ten problem
  • 2 wyświetlenia
  • Ostatnia odpowiedź od sheybey

more options

I'm using 64-bit firefox developer edition 49.0a2 on windows 10.

I have a UTF-8 encoded text/plain document up on my server that is served with the proper Content-Type, but is decoded with the wrong encoding (iso-8859-1, I think) when loaded from the cache. I assume this is because the encoding is not stored in the cache, but I am not sure how to look into the problem further.

Is this a bug? If so, where should I file a bug report?

If your default encoding is not utf-8, you should be able to reproduce the issue by visiting the document and then reloading with the developer tools closed. ctrl-F for "- quick fix", underneath it should be the word "ÜberCharge" which will decode incorrectly with a different encoding.

http://tf.heybey.org/hlds_announce

I'm using 64-bit firefox developer edition 49.0a2 on windows 10. I have a UTF-8 encoded text/plain document up on my server that is served with the proper Content-Type, but is decoded with the wrong encoding (iso-8859-1, I think) when loaded from the cache. I assume this is because the encoding is not stored in the cache, but I am not sure how to look into the problem further. Is this a bug? If so, where should I file a bug report? If your default encoding is not utf-8, you should be able to reproduce the issue by visiting the document and then reloading with the developer tools closed. ctrl-F for "- quick fix", underneath it should be the word "ÜberCharge" which will decode incorrectly with a different encoding. http://tf.heybey.org/hlds_announce

Wszystkie odpowiedzi (4)

more options

A possible workaround is to add a UTF-8 BOM at the start of the file. Then it also works if you save the file to the hard drive.

more options

Yeah, that would prevent the issue from occurring for this file, but I am wondering if this is a bug or not. Are you saying it isn't?

more options

Firefox default to iso-8859-x encoding, so when the encoding that the server sends isn't available then you get issues. I use some text files in pinned tabs to quickly access notes and answers to question and came across this issue and decided to add the BOM to avoid having to correct the encoding on each page reload. An HTML file can have a meta tag to set the encoding and a text file a byte order mark.

more options

Yes, I am aware of that. Allow me to restate my question:

Firefox does not cache the encoding of plain text files. Is this a bug? If so, where should I report it?