blitzer
1
I have read text by this code
message = ""
file = File.new(fileDirectory , "r")
while line = file.gets
message = message+line
end
file.close
puts message
@textbox1.set_value(message)
fileDirectory is a path of text file
@textbox1 is textctrl that I want to show text in that file
and I have problem, it can only read text file with Encoding UTF-8, it
can’t read from ANSI to show in textctrl (@textbox1) but
puts message
can show message normally with encode UTF-8 and ANSI
now I have problem how I can show text with encode ANSI in @textbox1??
:’(
blitzer
2
Pat K. wrote:
@textbox1.set_value(message)
now I have problem how I can show text with encode ANSI in @textbox1??
That sounds toolkit-specific. What GUI library are you using?
blitzer
4
On Nov 26, 3:10 am, Pat K. [email protected] wrote:
@textbox1.set_value(message)
How is the above different or better than:
message = IO.read( fileDirectory )
?
blitzer
5
Dont know about wxruby but in ruby-gtk you can use Glib to convert
charsets
But as someone else wrote before here, play around with iconv or similar
to convert it before displaying on your GUI