-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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 "encoding" configuration. (3rd version) #1367
Conversation
@kelvinst Thank you for your review.
I have fixed. |
+1 to include patch. I found encoding issue and this patch should solve my issue too. I planned to create a patch if I can't find any. |
👍 |
1 similar comment
+1 |
Before we can accept this patch, we need tests to make sure we don't break it in the future. |
Why not set your system |
There are two reason.
|
I was trying to create test to pass, but unfortunately, in my environment with ruby 1.9.3, the test does not pass. I pulled upstream and ran test, still failing. And it's related to encoding. Anything you know?
|
@shigeya Please try a my experimental patch: https://github.com/koron/jekyll/commit/4435c565d4097ea2a5f0dad10df88ff1e6c244aa |
@koron I don't like to introduce default_external config even in a test. How about this? This commit introduce optional parameter to |
I've sent a pull request on that fix. |
@shigeya 👍 But, It seems to conflict with changes of this pull request 😉 |
You're right. I think you can make the default to Convertible.read_yaml read from the configured parameter, not |
I have added two commits to show my intention, on top of @koron's branch: https://github.com/shigeya/jekyll/tree/config-encoding-and-yaml-opts As @parkr suggested, we need to have tests for the configuration part. |
The |
Yes. And the changes on this branch take care of that. Thus, 1) the encoding related test won't run on 1.8.7, and 2) unless user specifically configure to pass encoding parameter(s), it will not see any encoding related requests. In my environment, all tests pass without any issue on 1.8.7-p371, 1.9.3-p448 and 2.0.0-p247. Part of the problem of the encoding is, UTF-8 file is not readable by default encoding (ASCII-8BIT) on 1.9.x and beyond. The solution like this patch, or, global configuration of external encoding config (wrapped with >=1.9.3) conditional) is the only solution. |
We must know most of users who uses multi-byte with ruby2.0 on windows are lost to get the way to run jekyll. :-( |
So I ran this pull request on Jekyll's site with ruby 1.8.7 and added the following to encoding: utf-8 and this is what I got when I tried to generate the site. $ jekyll build
Configuration file: /Users/matt/Code/jekyll/site/_config.yml
error: uninitialized constant Jekyll::Site::Encoding. Use --trace to view backtrace this makes Jekyll incompatible with ruby 1.8.7 which is not acceptable at this point in time as we've committed to maintaining backward compatibility with that version of Ruby until Jekyll 2.0. This incompatibility will need to be fixed before this pull request can be merged. |
Oh, I overlooked the issue. I (or @koron ?) will provide fix to that. (+ tests on that too) |
I have added a commit shigeya@491fc04 to the branch. Just pass encoding parameter as a string. We can wrap it with RUBY_VERSION variable if we prefer (may be little performance improvement to fetch the object itself.) @mattr, please confirm you can build without problem. (I also curious why We need test. @koron, Do you wiling to write tests? if not, I can write some. |
No, I cann't now or soon. Please write it. |
I have created another pull request #1449 for this, to avoid confusion. We need tests, but need some input to how to implement. |
Encoding of input files should be determined by site settings (configuration).
Currently, it is determined by OS or environment settings implicitly.
This patch make it configurable.
(This request is revised version of #1365, #1366)