Forum: Ruby Re: Strange print

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Gennady B. (Guest)
on 2006-01-31 18:02
(Received via mailing list)
I am not completely sure, but you can try to play with $KCODE variable
settings. I am sure you know this, put 'p "abc"' is equivalent to 'puts
"abc".inspect' and 'inspect' outputs non-printable characters in escaped
form (like '\n' or '\326').

UPDATE: I just checked that with $KCODE = 'u', p shows "College" in
Russian just like that -- "bea[u]tiful text" ;-).

This topic is locked and can not be replied to.