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

App should specify encoding: utf-8 #133

Open
beret opened this issue Jul 21, 2012 · 3 comments
Open

App should specify encoding: utf-8 #133

beret opened this issue Jul 21, 2012 · 3 comments

Comments

@beret
Copy link

beret commented Jul 21, 2012

As soon as I use a UTF-8 character in the config file, earthquake refuses to start, giving this error:

/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load': /home/user/.earthquake/config:5: invalid multibyte char (US-ASCII) (SyntaxError)
/home/user/.earthquake/config:5: invalid multibyte char (US-ASCII)
/home/user/.earthquake/config:5: syntax error, unexpected $end, expecting '}'
    :more_char => '…'
                     ^

To solve this, all that's needed is to put # encoding: utf-8 as the second line of bin/earthquake,
right below #!/usr/bin/env ruby.

@no6v
Copy link
Collaborator

no6v commented Jul 21, 2012

You can specify your favorite encoding, that may be utf-8 though :), at the top of your configuration file like:

$ head -n1 ~/.earthquake/config
# coding: utf-8

works fine on my environment. Would you try this?

Thanks,

@beret
Copy link
Author

beret commented Jul 21, 2012

That works fine here.
Would it make sense to include that in the standard config, since it's a common encoding now?

@no6v
Copy link
Collaborator

no6v commented Jul 21, 2012

$ head -n2 ~/.earthquake/config | hd
00000000  23 20 63 6f 64 69 6e 67  3a 20 69 73 6f 2d 38 38  |# coding: iso-88|
00000010  35 39 2d 31 0a 45 61 72  74 68 71 75 61 6b 65 2e  |59-1.Earthquake.|
00000020  63 6f 6e 66 69 67 5b 3a  70 72 6f 6d 70 74 5d 20  |config[:prompt] |
00000030  3d 20 27 e6 e7 e8 20 27  0a                       |= '... '.|
00000039
$ locale charmap
UTF-8
$ earthquake --no-logo
æçè> 

I guess the prompt was converted automatically from iso-8859-1 to UTF-8 (due to default_external).
Encoding of config file can be specified as per user's choice if it can be converted to UTF-8.
Right?

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

No branches or pull requests

2 participants