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

Encoding issues #299

Open
wush978 opened this issue May 20, 2015 · 2 comments
Open

Encoding issues #299

wush978 opened this issue May 20, 2015 · 2 comments

Comments

@wush978
Copy link
Contributor

wush978 commented May 20, 2015

Dear all,

First of all, I want to thank for your great work of swirl and swirlify.

I want to use swirl in a workshop for introducing R in Chinese, but I have an encoding issue. The yaml::yaml.load_file only parse UTF-8 encoded document and the rendering in windows is failed.

The following images show the failure with the swirl installed from github:
swirl-chinese-utf8

Inspired by vubiostat/r-yaml#6, I mark the Encoding to the raw_yaml in parse_content.yaml master...wush978:master. The rendering of the Chinese text becomes normal:
swirl-chinese-utf8-2

Could I give you a PR to resolve this issue?

Best,
Wush

@seankross
Copy link
Member

Please send us a PR! I'd be happy to help you work on this.

@wush978
Copy link
Contributor Author

wush978 commented May 21, 2015

Dear @seankross ,

You could check #300 for the proposed solution. The wrap_encoding recursively mark the encoding of all strings returned from yaml parser. I like to hear any comment from you about this approach.

However, I just notice that the wrap_encoding will trigger error when the raw_yaml contains non-list and non-character object. It is easy to fix this, but I think it's better do it after hearing your feedback.

And it seems that the test cases does not detect this error ( #300 passes the CI ). I could send a PR to detect such kind of error in another PR if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants