Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Learn More

Some local plaintext files in latin encoding rendered with japanese font settings

  • Нет ответов
  • 0 имеют эту проблему
  • 47 просмотров
more options

A certain set of plaintext files are rendered in a weird way when opened in Firefox.

Some plaintext files are rendered "MS Gothic", which is the default monospace font for plaintext files in Japanese encoding. (Also, if I change font.name-list.monospace.ja to "monospace", the font changes).

However, the files are not in Japanese encoding, they do not contain a single character in Japanese encoding. Since the files are local, they have no HTTP headers to determine the encoding, so Firefox must have guessed the encoding somehow. How can I stop firefox from detecting those files as Japanese while they are not?

Also, I noticed that this issue happens only with long files. The shorter a file, the less likely it is that Firefox renders the file as if it had Japanese encoding.

Since I cannot reproduce the issue with smaller files and the files contain confidential information, I am unable to provide a minimal reproducer.

As a workaround, I could change font.name-list.monospace.ja, but this would change (potentially break) rendering of Japanese websites.

I'm using Firefox 124.0.1 on Windows 10, although this issue has been present for at least some months (at least 4 firefox releases).

The screenshot shows an excerpt where the text "C:\Temp\2024-" is partially rendered with Japanese glyphs and fully rendered with "MS Gothic" font which is hard to read with ASCII characters.

PS: I [censored] some of the information in the "Troubleshooting Information" field below.

A certain set of plaintext files are rendered in a weird way when opened in Firefox. Some plaintext files are rendered "MS Gothic", which is the default monospace font for plaintext files in Japanese encoding. (Also, if I change font.name-list.monospace.ja to "monospace", the font changes). However, the files are not in Japanese encoding, they do not contain a single character in Japanese encoding. Since the files are local, they have no HTTP headers to determine the encoding, so Firefox must have guessed the encoding somehow. How can I stop firefox from detecting those files as Japanese while they are not? Also, I noticed that this issue happens only with long files. The shorter a file, the less likely it is that Firefox renders the file as if it had Japanese encoding. Since I cannot reproduce the issue with smaller files and the files contain confidential information, I am unable to provide a minimal reproducer. As a workaround, I could change font.name-list.monospace.ja, but this would change (potentially break) rendering of Japanese websites. I'm using Firefox 124.0.1 on Windows 10, although this issue has been present for at least some months (at least 4 firefox releases). The screenshot shows an excerpt where the text "C:\Temp\2024-" is partially rendered with Japanese glyphs and fully rendered with "MS Gothic" font which is hard to read with ASCII characters. PS: I [censored] some of the information in the "Troubleshooting Information" field below.
Приложенные скриншоты

Для ответа на сообщения вы должны войти в свою учётную запись. Пожалуйста, задайте новый вопрос, если у вас ещё нет учётной записи.