Forum: Ruby Chinese Search Parameters/Unicode Support

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.
8dba11fb458de3101593e92c2a873a78?d=identicon&s=25 guest (Guest)
on 2007-06-29 04:53
Okay a preface, I wish to keep this as simple as possible, so I'm trying
to work off the basic ruby library with no gems installed (would not
have a problem with this however)

Basically, I wish to have the program prompt the user for a keyword to
search by, all is well with my app, except I have no idea how to
implement a way for the input to be in chinese/japanese/korean

so something along the lines of:

$kcode = 'u'
require 'iconv'

print "please enter search parameter: "
search = gets.chomp

now I tried using'Big5', 'UTF-8').Iconv(search) <--where
search is asian characters, at least before ruby gets a hold of them

... but this really does nothing.  How can I get that user input of
chinese/japanese/korean characters to be stored for use later on (to
split/concatenate to other strings etc)

again, not in rails so most previous topics don't cater to this sort of
idea.  thanks
This topic is locked and can not be replied to.