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

Add a charset note in "Writing Posts" doc page #1902

Merged
merged 1 commit into from Jan 2, 2014

Conversation

Projects
None yet
4 participants
@troyswanson
Member

troyswanson commented Jan 2, 2014

There have been a couple of issues recently (#1858 and #1891) that involve browsers rendering some quotation characters improperly due to the charset meta value not being defined in the HTML of the layout. This little note seeks to provide some guidance to avoid that issue, and other issues that may crop up around content processor character substitution magic.

(I also removed a space character elsewhere in the page that shouldn't be there.)

@parkr

View changes

site/docs/posts.md Outdated
For example, the <code>smart</code> extension in Redcarpet converts standard,
ASCII quotation characters to curly, Unicode ones. In order for the browser
to display those characters properly, the UTF-8 character set needs to be
defined in the HTML for your layout.

This comment has been minimized.

@parkr

parkr Jan 2, 2014

Member

defined in the HTML for your layout: <code>&lt;meta charset=&quot;utf-8&quot;&gt;</code>

Thoughts?

This comment has been minimized.

@troyswanson

troyswanson Jan 2, 2014

Member

The goal wasn't to give folks a cheat sheet, but instead to introduce them to the concept of character sets in general. All of that said, I think you're probably right. It's good form to fully explain the example given, eh? 😉

This comment has been minimized.

@parkr

parkr Jan 2, 2014

Member

Boom. 😃

@troyswanson

This comment has been minimized.

Member

troyswanson commented Jan 2, 2014

@parkr, I just amended my commit. Hope this helps!

parkr added a commit that referenced this pull request Jan 2, 2014

@parkr parkr merged commit 986f9aa into jekyll:master Jan 2, 2014

1 check passed

default The Travis CI build passed
Details

parkr added a commit that referenced this pull request Jan 2, 2014

@parkr

This comment has been minimized.

Member

parkr commented Jan 2, 2014

Thanks @troyswanson ❤️

@pathawks

This comment has been minimized.

Member

pathawks commented Jan 7, 2014

It's not just a matter of adding <meta charset="utf-8">, since by default Jekyll will output ASCII.
The best way to make sure the character encodings match is by adding <meta charset="utf-8"> to the output, and encoding: "UTF-8" to the _config.yml

@troyswanson

This comment has been minimized.

Member

troyswanson commented Jan 13, 2014

I don't know much about how Jekyll encodes and outputs files, but maybe that encoding configuration parameter is being overridden by the Markdown parsers. I've never had to deal with that param, but the overall system is certainly outputting files that are encoded in utf-8. Maybe this needs more investigation/clarification.

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.