-------- Original-Nachricht --------
Datum: Sun, 1 Jul 2007 12:32:37 +0900
Von: Guest [email protected]
An: [email protected]
Betreff: Newbie Question (gets.chomp)
i run into trouble when the user enters non english search terms. how
can i set this up to allow the user to enter other language words?
this is due to different encodings used in the console and in the text
document you’re searching in.
You can tell a Ruby script to use Unicode encoding by setting
or use Iconv
to convert between different encodings,e.g.,
if you need to convert from Western European ISO-8859-1 to
puts “What do you want to search for?”
now, search for search_what (in UTF-8 encoding ) in a text
(which is also in UTF-8 encoding ) …