Forum: Ruby language encoding

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
97ab1ad2cf9dfb93e2bcb2032f2ca471?d=identicon&s=25 Jörg Hagmann (Guest)
on 2007-01-10 17:04
(Received via mailing list)
I have written a simple answer-question programme (to be used in the
terminal) for students and I need French and German characters (à, ü
etc.):
I've written it in Emacs, on a mac, English keyboard and operating
system. It worked.
When I tried it on a Linux computer (English environment) it didn't.
I then thought I figured it out: I chose utf-8 wherever possible in
Emacs (e.g. "set coding system for saving this buffer", without
understanding what exactly I was doing, I'm afraid) and by including
$KCODE = 'UTF-8'
require 'jcode'
in my file (something I got from the "Ruby cookbook"). That worked --
on the Linux box. But the file no longer showed the correct
characters on the Mac. And it also didn't on a Windows machine.

As I was planning to distribute the programme to the students on
Monday, and as I'm sure it won't work on their mainly Windows boxes
running whatever language, I decided to ask for help here. You must
have understood from my question that any answer should be kept as
simple as possible...
Thanks in advance, Jörg.

Prof.Dr.med. Jörg Hagmann-Zanolari
Institute of Biochemistry and Genetics
DKBW, University of Basel
Mattenstrasse 28
CH-4058 Basel
Switzerland
Phone +41 (0)61 267 3565
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2007-01-10 17:20
(Received via mailing list)
On Jan 10, 2007, at 08:04, Jörg Hagmann wrote:
> require 'jcode'
> in my file (something I got from the "Ruby cookbook"). That worked
> -- on the Linux box. But the file no longer showed the correct
> characters on the Mac. And it also didn't on a Windows machine.

If this is a terminal program then on the mac ensure that the
terminal character set encoding is set to UTF-8.  You can find this
setting in the Display settings of the Window Settings dialog under
the Terminal menu.

> Mattenstrasse 28
> CH-4058 Basel
> Switzerland
> Phone +41 (0)61 267 3565
>
>

--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!
This topic is locked and can not be replied to.