From: Mark Hubbart Date: 2005-04-28T08:39:25+09:00 Subject: Re: $KCODE reference documentation On 4/27/05, Bertram Scharpf 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