steve8x8 / geotoad

Geocaching query tool written in Ruby
https://buymeacoffee.com/steve8x8
Other
28 stars 8 forks source link

Geotoad refuses to run: Invalid multibyte char #291

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
[Please include the relevant parts of your command line, if applicable.
Don't send your password though!]
1. Download latest geotoad version from svn
2. Try to start it

What is the expected output? What do you see instead?
Geotoad should run.

Instead:

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 
/home/jan/code/geotoad-read-only/lib/details.rb:460: invalid multibyte char 
(US-ASCII) (SyntaxError)
/home/jan/code/geotoad-read-only/lib/details.rb:460: invalid multibyte char 
(US-ASCII)
/home/jan/code/geotoad-read-only/lib/details.rb:460: syntax error, unexpected 
$end, expecting keyword_end
        cache['latwritten'] = $1 + ' ' + $2 + '° ' + $3
                                                 ^
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from geotoad.rb:36:in `<main>'

What version of the product are you using? On what operating system?
[Did you check you're using the latest version?]

# svn info
Path: .
Working Copy Root Path: /home/jan/code/geotoad-read-only
URL: http://geotoad.googlecode.com/svn/trunk
Repository Root: http://geotoad.googlecode.com/svn
Repository UUID: abbcce6f-711e-0410-a2ab-651830b4d790
Revision: 1512
Node Kind: directory
Schedule: normal
Last Changed Author: Steve8x8@googlemail.com
Last Changed Rev: 1512
Last Changed Date: 2013-11-26 12:41:37 +0100 (Di, 26 Nov 2013)

# uname -a
Linux contrail 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux

# ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

Original issue reported on code.google.com by jan.reuc...@gmail.com on 1 Dec 2013 at 6:42

GoogleCodeExporter commented 9 years ago
Fixed by adding a magic comment as first line of lib/details.rb

# -*- encoding : utf-8 -*-

As I'm currently testing ruby 2.0 (actually I took some time off...) I didn't 
spot this (why oh why do ruby 1.9 and 2.0 behave so different?). Apologies...

Original comment by Steve8x8 on 2 Dec 2013 at 8:15

GoogleCodeExporter commented 9 years ago
Steve,

many thanks for the quick fix! Works like a charm!

Best regards,
Jan

Original comment by jan.reuc...@gmail.com on 2 Dec 2013 at 5:49

GoogleCodeExporter commented 9 years ago
Thanks Jan for your contribution.

There's another *.rb file containing UTF-8 (as "file" shows): lib/search.rb - 
but in this case, it's only a comment (and I hate superfluous magic comments).

Status: As this issue wasn't present in the current stable version it doesn't 
make sense to leave it open (as in "FixAvail"). Closing...

Original comment by Steve8x8 on 3 Dec 2013 at 9:50