Umlauts in source code

Hi,

on my Debian Linux this problem doesn't appear. Yet, it is
reported to me that on SuSE Linux, the standard Ruby
installation has problems with reading in source files that
contain umlauts (characters >= '\x80').

A string 'ü' produces a syntax error, a regexp /ü/ will
report a "premature end" of the regexp.

I made experiments with $KCODE but I didn't achieve to
reproduce the reported misbehaviour.

I could enter '\xfc' everywhere I need a 'ü' but that is
annoying.

What do I have to do to solve this correctly?

Thanks in advance,

Bertram

···

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de

Hi,

···

In message "Re: Umlauts in source code" on Thu, 20 Jan 2005 20:45:49 +0900, Bertram Scharpf <lists@bertram-scharpf.de> writes:

on my Debian Linux this problem doesn't appear. Yet, it is
reported to me that on SuSE Linux, the standard Ruby
installation has problems with reading in source files that
contain umlauts (characters >= '\x80').

I think the difference is the default KCODE value in the compile time
configuration. One needs to set -Kn when he wants to put iso-8859
letters. The simple

  #! /usr/bin/ruby -Kn

at the beginning of a file will do.

              matz.

Hi,

···

Am Donnerstag, 20. Jan 2005, 22:58:05 +0900 schrieb Yukihiro Matsumoto:

In message "Re: Umlauts in source code" > on Thu, 20 Jan 2005 20:45:49 +0900, Bertram Scharpf <lists@bertram-scharpf.de> writes:

>on my Debian Linux this problem doesn't appear. Yet, it is
>reported to me that on SuSE Linux, the standard Ruby
>installation has problems with reading in source files that
>contain umlauts (characters >= '\x80').

I think the difference is the default KCODE value in the compile time
configuration. One needs to set -Kn when he wants to put iso-8859
letters. The simple

  #! /usr/bin/ruby -Kn

at the beginning of a file will do.

Ah, yes! As I noiticed in the meantime, SuSE sets $KCODE by
default to "UTF-8".

Bertram

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de

Hi,

> #! /usr/bin/ruby -Kn

I would like to propose a solution similar to that in Python
since

    #!/usr/bin/env ruby -Kn

doesn't work. In Python, the second line is allowed to give
the character encoding:

    #!/usr/bin/env python
    # -*- coding: iso-8859-15 -*-

Or does anybody know a better solution?

Bertram

···

Am Freitag, 21. Jan 2005, 02:40:07 +0900 schrieb Bertram Scharpf:

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de

Or does anybody know a better solution?

See [ruby-core:4192]

   http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-core/4192

Guy Decoux

Hi Guy,

···

Am Sonntag, 23. Jan 2005, 02:02:31 +0900 schrieb ts:

> Or does anybody know a better solution?

See [ruby-core:4192]

   http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-core/4192

Ah, thanks!

Bertram

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de