Skip to content

Conversation

@YDX-2147483647
Copy link
Contributor

@YDX-2147483647 YDX-2147483647 commented Oct 11, 2025

When running typst watch for the html target, a placeholder html will show up if a new error occurs.
However, this placeholder html contains the non-ascii character , but does not specify <meta charset='utf-8'>.
As a result, some browsers will guess the encoding, which could be wrong.
This PR fixes it.

Example: Firefox on my computer interprets it as windows-1252/latin1:

图片 图片

Waiting for output…

此页面处于怪异模式,排版布局可能会受到影响。若需要标准模式,请使用“<!DOCTYPE html>”。
Translate: This page is in a strange mode, and the layout may be affected. If you need the standard mode, please use "<!" DOCTYPE html>".

该文档未声明字符编码,因此编码是凭内容猜测出来的。字符编码需使用 <meta> 标签或字节顺序标记(BOM),或是在 Content-Type HTTP 头中进行声明。
Translate: This document does not state the character encoding, so the encoding is guessed based on the content. The character encoding needs to use the <meta> tag or the byte order tag (BOM), or be declared in the Content-Type HTTP header.

@laurmaedje laurmaedje added this pull request to the merge queue Oct 13, 2025
@laurmaedje laurmaedje removed this pull request from the merge queue due to a manual request Oct 13, 2025
@laurmaedje laurmaedje added this pull request to the merge queue Oct 13, 2025
@laurmaedje
Copy link
Member

Thanks!

Merged via the queue into typst:main with commit 3bbf902 Oct 13, 2025
8 checks passed
@YDX-2147483647 YDX-2147483647 deleted the charset branch October 13, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants