Skip to content

Use 'utf-8' instead of 'utf8' to be standard compliant.#801

Closed
evantill wants to merge 2 commits into
docpad:masterfrom
apelsophiebarat:hotfix/utf8
Closed

Use 'utf-8' instead of 'utf8' to be standard compliant.#801
evantill wants to merge 2 commits into
docpad:masterfrom
apelsophiebarat:hotfix/utf8

Conversation

@evantill
Copy link
Copy Markdown

Using 'utf8' is not compatible with some IE versions like IE9 (loading page throw a script error “c00ce56e”).

see this article on invalid charset

also see section "Official name and variants" in wikipedia and http://www.w3.org/International/O-HTTP-charset

Other descriptions that omit the hyphen or replace it with a space, such as "utf8" or "UTF 8", are not accepted as correct by the governing standards.

note: in html5boilerplate the charset is defined as utf-8

@RobLoach
Copy link
Copy Markdown
Contributor

Looking through some of the node documentation, there are references to utf8. Buffer is an example of this. utf-8 works though. Very strange, I'd suggest going with what's commonly in the official node docs, I could be convinced otherwise.

@evantill
Copy link
Copy Markdown
Author

we could keep utf8 for IO operations.
But for charset in http header this is a problem. utf-8 is the standard.

If we keep utf8 in headers, some browsers will not work with docpad.

So ?

@evantill
Copy link
Copy Markdown
Author

as a counter example see Express. They use utf-8 every where.
response.js#L112

@RobLoach
Copy link
Copy Markdown
Contributor

👍

Use 'utf8' for IO operations but use 'UTF-8' for value of encoding parameters.
@evantill
Copy link
Copy Markdown
Author

like that ?

@RobLoach
Copy link
Copy Markdown
Contributor

Oh, sorry, I was happy with using it everywhere 😀 . I suppose it's up to you and Ben!

@balupton
Copy link
Copy Markdown
Member

For now, let's keep it for just the charset header 👍 Updating the others would mean we would also have to update https://github.com/bevry/istextorbinary/ in which utf8 is used within itself and the encoding/decoding dependency it uses. So the best approach appears to be just renaming to utf-8 only where it is essential (in this case charset header), and won't possibly break b/c, extensions, or start a snowball of renames across our own projects and all our dependencies.

@RobLoach loves his emoji's :)

@RobLoach
Copy link
Copy Markdown
Contributor

@evantill
Copy link
Copy Markdown
Author

Thanks.
I already changed the PR in this way. Can you confirm that this PR is ok like that ?

@balupton balupton closed this in 4f604f4 Feb 21, 2014
balupton added a commit that referenced this pull request Feb 21, 2014
- v6.63.7 February 21, 2014
	- Fixed IE9 and below not understanding the charset we send
		- Thanks to [Eric Vantillard](https://github.com/evantill) for [issue #801](#801)
	- Better debugging for invalid watch states
		- For more information see [issue #792](#792)
	- Fixed DocPad failing to serve files after the initial generation once the docpad configuration file has been modified
		- Thanks to [Michael Williams](https://github.com/ahdinosaur) for [issue #811](#811)
	- Updated dependencies
@evantill
Copy link
Copy Markdown
Author

Thank you. I will test it next week.

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.

3 participants