Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/html/charset: can't decode charset to UTF-8 #9653

Closed
seago opened this issue Jan 21, 2015 · 3 comments
Closed

x/net/html/charset: can't decode charset to UTF-8 #9653

seago opened this issue Jan 21, 2015 · 3 comments

Comments

@seago
Copy link

seago commented Jan 21, 2015

For this example:
<!--
.......
-->
<html>
.....
</html>

This comments in html length is large than 1024.

@mikioh mikioh changed the title golang.org/x/net/html/charset can't decode charset to UTF-8 html/charset: can't decode charset to UTF-8 Jan 21, 2015
@seago
Copy link
Author

seago commented Jan 22, 2015

This comment part larger than 1024 bytes

@bradfitz
Copy link
Contributor

/cc @nigeltao

@nigeltao
Copy link
Contributor

nigeltao commented Feb 9, 2015

This is working as intended. http://godoc.org/golang.org/x/net/html/charset#DetermineEncoding says that DetermineEncoding determines the encoding of an HTML document by examining up to the first 1024 bytes of content and the declared Content-Type.
See http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding and that spec says "The authoring conformance requirements for character encoding declarations limit them to only appearing in the first 1024 bytes."

@nigeltao nigeltao closed this as completed Feb 9, 2015
@mikioh mikioh changed the title html/charset: can't decode charset to UTF-8 x/net/html/charset: can't decode charset to UTF-8 Aug 5, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants