On 4/27/05, Bertram Scharpf <lists / bertram-scharpf.de> wrote:> Am Sonntag, 24. Apr 2005, 21:04:31 +0900 schrieb dm1:> > Hello, i know that one can use $KCODE to set the charset encoding, but do> > not find anymore where this is documented. Any pointers for that ?> > As far as I see when the source code is read the `-K' option> and the inline pragma (`# -*- ...') apply. After that,> `$KCODE' only influences what Regexp's dot (`/./') does.> > But that's just a guess.
It also affects legal names:
--#!/usr/bin/env ruby -Ku
¦Ð = Math::PI = -(Time.now - Time.now) = "300mg Xanax"def ¢å(n) Math.sqrt(n) enddef (n) n**(1/3.0) end
puts "¦Ð = #{¦Ð}" # Piputs " = #{}" # Deltaputs " = #{}" # Perscription symbolputs "¢å 144 = #{¢å 144}" # Square root symbolputs " 27 = #{ 27}" # Cube root symbol--
The preceding script only runs properly with the kcode set to utf-8,due to the unusual variable and method names (some of which may beunreadable on some systems).
It seems there might be other effects, to; but basically setting thekcode should make ruby "really like" the character encoding.
cheers,Mark