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

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

Closed
wants to merge 2 commits into from
Closed

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

wants to merge 2 commits into from

Conversation

evantill
Copy link

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
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
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
Author

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

@RobLoach
Copy link
Contributor

👍

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

like that ?

@RobLoach
Copy link
Contributor

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

@balupton
Copy link
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
Contributor

@evantill
Copy link
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
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