Forum: Ruby Re: Premature end of regular expression with non-ascii chara

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
K.Kosako (Guest)
on 2006-01-31 14:20
(Received via mailing list)
> Thank you both very much for the suggestions. First off I have
> $KCODE="u" in config/environment.rb (Rails). I have also tried to add it
> into the class. But the error remained.

This problem is quite unrelated to Oniguruma.
I doubt that you are writing the script with ISO 8859-1.

(In the following, kine is with accent.)

[kosako@noa test]$ file iso-8859-1.rb utf-8.rb
iso-8859-1.rb: ISO-8859 text
utf-8.rb: UTF-8 Unicode text
[kosako@noa test]$ cat iso-8859-1.rb
reg = /kine/u
[kosako@noa test]$ cat utf-8.rb
reg = /kine/u
[kosako@noa test]$ ~/work/ruby-1.8.4/ruby iso-8859-1.rb
iso-8859-1.rb:1: premature end of regular expression: /kin
[kosako@noa test]$ ~/work/ruby-1.8.4/ruby utf-8.rb
[kosako@noa test]$
This topic is locked and can not be replied to.