Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Multibyte error under Ruby 1.9.1

#19

I've tracked down a problem with Webby It turns out that it has some non-ascii characters in at least one file; for example the second quote in the regular expression below is not an ASCII character:

parts = self.split( %r/( [:.;?!][ ] | (?:[ ]|^)["“] )/x )

webby-0.9.4/lib/webby/core_ext/string.rb

It produces errors like this:

:in `require': /opt/local/lib/ruby1.9/gems/1.9.1/gems/webby-0.9.4/lib/webby/core_ext/string.rb:14: invalid multibyte char (US-ASCII) (SyntaxError)

I fixed it by adding the following to the top of the offending file:

# encoding: utf-8

You might consider adding it to all your files

Reported by Martin Hess · June 23rd, 2009 @ 01:48 AM

State: new
Milestone: none
Assigned to: nobody

Activity

  1. Roger
    Roger

    got this too

    C:\dev\ruby>webby-gen website my_site
    c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/webby-0.9.4/lib/webby.rb:104:in require': c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/webby-0.9.4/lib/webby/core_ext/string.rb:15: invalid multibyte<br/> char (US-ASCII) (SyntaxError)<br/> c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/webby-0.9.4/lib/webby/core_ext/string.rb:15: invalid<br/> multibyte char (US-ASCII)<br/> c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/webby-0.9.4/lib/webby/core_ext/string.rb:15: syntax error, unexpected $end, expecting ')'<br/>

    parts = self.split( %r/( [:.;?!][ ] | (?:[ ]|^)["ΓÇ£] )/x )
    

    July 17th, 2009 @ 06:22 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.