$KCODE reference documentation

D

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 ?

Thanks

Denis
 
B

Bertram Scharpf

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.

Bertram
 
M

Mark Hubbart

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
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top