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

In the execution of the order when generate appear the error information listed below, and then the file content becomes "Liquid error: incompatible character encodings: utf-8 and CP850" #413

Closed
DrayChou opened this issue Feb 10, 2012 · 8 comments

Comments

Projects
None yet
8 participants
@DrayChou
Copy link

commented Feb 10, 2012

In the execution of the order when generate appear the error information listed below, and then the file content becomes "Liquid error: incompatible character encodings: utf-8 and CP850"

md file type is unix, ansi as utf-8

md File Content Like this:

--- 
categories: 
  - "C#"
comments: true
layout: post
published: true
status: publish
tags: []
title: "修改 vs2010 默认浏览器"
type: post

---
修改该目录里的配置文件

C:\Users\[登陆账户ID]\AppData\Local\Microsoft\VisualStudio\10.0\browsers.xml
修改为

{% codeblock %}

<?xml version="1.0"?><browserinfo><browser><name>Mozilla Firefox</name><path>"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"</path><resolution>0</resolution><isdefault>True</isdefault></browser><browser><name>Internet Explorer</name><path>"C:\Program Files (x86)\Internet Explorer\iexplore.exe"</path><resolution>0</resolution><isdefault>False</isdefault><dde><service>IExplore</service><topicopenurl>WWW_OpenURL</topicopenurl><itemopenurl>"%s",,0xffffffff,3,,,,</itemopenurl><topicactivate>WWW_Activate</topicactivate><itemactivate>0xffffffff,0</itemactivate></dde></browser></browserinfo>

{% endcodeblock %}


然后保存为只读,Ok了

My Sys:

# Rails Environment Configuration.

---
git:
  user.name:  DrayChou
  version:    git version 1.7.6.msysgit.0

ruby:
  bin:        d:/RailsInstaller/Ruby1.9.2/bin/ruby.exe
  version:    ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

rails:
  bin:        d:/RailsInstaller/Ruby1.9.2/bin/rails.bat
  version:    Rails 3.2.1

rake generate Message:

D:\Dray\U\Git\MyOctopressBlogTest>bundle exec rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from D:/Dray/U/Git/MyOctopressBlogTest/_config.yml
Building site: source -> public
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in index.html
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in index.html
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Successfully generated site: source -> public

rake preview message:

D:\Dray\U\Git\MyOctopressBlogTest>bundle exec rake preview
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000
[2012-02-10 09:24:37] INFO  WEBrick 1.3.1
[2012-02-10 09:24:37] INFO  ruby 1.9.2 (2011-07-09) [i386-mingw32]
[2012-02-10 09:24:37] INFO  WEBrick::HTTPServer#start: pid=7672 port=4000
Configuration from D:/Dray/U/Git/MyOctopressBlogTest/_config.yml
Auto-regenerating enabled: source -> public
[2012-02-10 09:24:42] regeneration: 1730 files changed
>>> Compass is polling for changes. Press Ctrl-C to Stop.
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in index.html
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in index.html
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
Liquid Exception: incompatible character encodings: UTF-8 and CP850 in atom.xml
127.0.0.1 - - [10/Feb/2012 09:26:20] "GET /blog/2011/05/17/automatically-generat
ed-navigation-menu-using-jquery/ HTTP/1.1" 200 4662 0.1040
@DrayChou

This comment has been minimized.

Copy link
Author

commented Feb 13, 2012

我已经解决这个问题了,要在 d:\RailsInstaller\Ruby1.9.2\setup_environment.bat 文件中添加下面两行

set LC_ALL=en_US.UTF-8
set LANG=en_US.UTF-8

或者直接在cmd 下执行上面这两句也可以。

@DrayChou DrayChou closed this Feb 13, 2012

@rmariuzzo

This comment has been minimized.

Copy link

commented Dec 13, 2012

In case of someone looking to solve this, just execute the following command on the current open Terminal: chcp 65001 (this will fix the encoding issue). Don't try to do it globally, like setting this trough the Windows Registry.

Source: http://joseoncode.com/2011/11/27/solving-utf-problem-with-jekyll-on-windows/

@robatron

This comment has been minimized.

Copy link

commented Dec 18, 2013

Landed on this thread when searching for a solution to a similar error when running Jekyll on Windows.

For fellow Jekyllers who might also land here, you can also set encoding: UTF-8 in your Jekyll _config.yml.

(@jfromaniello, FYI)

@jfromaniello

This comment has been minimized.

Copy link

commented Dec 18, 2013

thanks @robatron

@willbuildapps

This comment has been minimized.

Copy link

commented Jan 17, 2014

tks @robatron u save the day.

@zigomir

This comment has been minimized.

Copy link

commented Jan 19, 2014

Strange. This setting in _config.yml does not work for me. I have Ruby 2.0.0p353 installed. What helped me, was to run this command chcp 65001 before running rake generate.

@wmucheru

This comment has been minimized.

Copy link

commented Oct 1, 2014

for some reason, I added 'encoding: UTF-8' and it didn't work for me also. My fix required replacing characters e.g. all quotes with ones on my pc, worked like a charm

@mathiasslawik

This comment has been minimized.

Copy link

commented Feb 23, 2015

You can also add the option "-EUTF-8:UTF-8" to the ruby.exe command line options.

Jordan-T added a commit to Jordan-T/Jekyll-webpack-boilerplate that referenced this issue Aug 24, 2018

Fix windows errors
- Update gems
- Use rimraf
- Change `;` into `&&`

If error:
>  incompatible character encodings: UTF-8 and CP850

Run command `hcp 65001`

cf: imathis/octopress#413 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.