Skip to content

Commit 0b5d827

Browse files
Merge pull request #280 from jekyll/encoding
Fix encoding bug
2 parents 140a1f9 + 7aa0d98 commit 0b5d827

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ source 'https://rubygems.org'
44
gemspec
55

66
# Site dependencies
7-
gem 'minima'
87
gem 'jekyll-seo-tag'
98
gem 'jekyll-sitemap'

lib/jekyll-admin/data_file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def relative_path
3030

3131
# Returns unparsed content as it exists on disk
3232
def raw_content
33-
@raw_content ||= File.read(absolute_path)
33+
@raw_content ||= File.open(absolute_path, "r:UTF-8", &:read)
3434
end
3535

3636
# Returnes (re)parsed content using Jekyll's native parsing mechanism

spec/jekyll-admin/server/configuration_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def app
1515
it "updates the configuration" do
1616
config_path = File.expand_path "_config.yml", fixture_path("site")
1717
config_body = File.read(config_path)
18-
config_before = YAML.load(config_body)
18+
config_before = SafeYAML.load(config_body)
1919
config = config_before.dup
2020

2121
config["foo"] = "bar2"
@@ -33,7 +33,7 @@ def app
3333
it "doesn't inject the default collections" do
3434
config_path = File.expand_path "_config.yml", fixture_path("site")
3535
config_body = File.read(config_path)
36-
config_before = YAML.load(config_body)
36+
config_before = SafeYAML.load(config_body)
3737

3838
config = config_before.dup
3939
config["collections"]["test"] = { "foo" => "bar" }

0 commit comments

Comments
 (0)