Umlauts in source code

B

Bertram Scharpf

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
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: Umlauts in source code"

|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.
 
B

Bertram Scharpf

Hi,

Am Donnerstag, 20. Jan 2005, 22:58:05 +0900 schrieb Yukihiro Matsumoto:
In message "Re: Umlauts in source code"

|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
 
B

Bertram Scharpf

Hi,

Am Freitag, 21. Jan 2005, 02:40:07 +0900 schrieb Bertram Scharpf:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top