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

Set the default encoding to UTF-8. #152

Merged
merged 1 commit into from
Mar 24, 2015
Merged

Conversation

Baza207
Copy link
Contributor

@Baza207 Baza207 commented Jan 14, 2015

After making myself a little shell script to run on build of a scheme in Xcode, it would always fail on me, even though running it from the terminal worked fine. Setting the default encoding to UTF-8 seems to fix this issue.

Reference: https://github.com/berkshelf/berkshelf-api/issues/112 (near the bottom)
It's an encoding thing, notice how the JSON parser is trying to use US-ASCII as it's encoding. As of ruby 1.9 the encoding for JSON parser is explicit so you can either add this to the berks executable:
Encoding.default_external = "UTF-8"

@Baza207
Copy link
Contributor Author

Baza207 commented Jan 14, 2015

Looks like the fact I've never coded in Ruby has made it fail Travis CI check for some simple issues. 😟

Edit: Update commits, hopefully should pass now.

After making myself a little shell script to run on build of a scheme in Xcode, it would always fail on me, even though running it from the terminal worked fine. Setting the default encoding to UTF-8 seems to fix this issue.

Reference: https://github.com/berkshelf/berkshelf-api/issues/112 (near the bottom)
It's an encoding thing, notice how the JSON parser is trying to use US-ASCII as it's encoding. As of ruby 1.9 the encoding for JSON parser is explicit so you can either add this to the berks executable:
Encoding.default_external = "UTF-8"
@segiddins
Copy link
Collaborator

You should just set the LANGE env var

@Baza207
Copy link
Contributor Author

Baza207 commented Jan 15, 2015

Ok, I'm not sure how you would do that. Is thats something I'd do instead of the line I added or something that can be set when running jazzy?

@ghost
Copy link

ghost commented Feb 25, 2015

I also had this problem running jazzy from Jenkins. I had to manually set the lang variable with the following shell command: export LANG=en_US.UTF-8

jpsim added a commit that referenced this pull request Mar 24, 2015
Set the default encoding to UTF-8.
@jpsim jpsim merged commit 42a284d into realm:master Mar 24, 2015
jpsim added a commit that referenced this pull request Mar 24, 2015
@jpsim
Copy link
Collaborator

jpsim commented Mar 24, 2015

Thanks @Baza207!

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

Successfully merging this pull request may close these issues.

4 participants