Umlauts in source code

Discussion in 'Ruby' started by Bertram Scharpf, Jan 20, 2005.

  1. 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
    Bertram Scharpf, Jan 20, 2005
    #1
    1. Advertising

  2. Hi,

    In message "Re: Umlauts in source code"
    on Thu, 20 Jan 2005 20:45:49 +0900, Bertram Scharpf <> 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.
    Yukihiro Matsumoto, Jan 20, 2005
    #2
    1. Advertising

  3. 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 <> 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
    Bertram Scharpf, Jan 20, 2005
    #3
  4. Hi,

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

    --
    Bertram Scharpf
    Stuttgart, Deutschland/Germany
    http://www.bertram-scharpf.de
    Bertram Scharpf, Jan 22, 2005
    #4
  5. Bertram Scharpf

    ts Guest

    ts, Jan 22, 2005
    #5
  6. Bertram Scharpf, Jan 22, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Axel Dahmen
    Replies:
    3
    Views:
    4,412
    Axel Dahmen
    Apr 30, 2005
  2. John Dalberg
    Replies:
    1
    Views:
    1,853
    Joerg Jooss
    Feb 17, 2006
  3. Replies:
    10
    Views:
    1,008
    Shmuel (Seymour J.) Metz
    Nov 1, 2005
  4. Moritz Beller

    Where have all the umlauts gone?

    Moritz Beller, Nov 7, 2004, in forum: C++
    Replies:
    1
    Views:
    323
    Victor Bazarov
    Nov 7, 2004
  5. Joerg Lehmann

    Print formatted Strings with Umlauts

    Joerg Lehmann, Feb 11, 2004, in forum: Python
    Replies:
    4
    Views:
    369
    Joerg Lehmann
    Feb 12, 2004
Loading...

Share This Page