Austin Ziegler
2/14/2005 3:41:00 PM
On Mon, 14 Feb 2005 19:25:27 +0900, Jochen Immendoerfer
<jo@h0me.homelinux.net> wrote:
> Hi,
>
> I am using win32ole for excel-automation. Currently I need to cope with a
> spreadsheet containing cyrillic characters.
>
> The following excample code demonstrates my problem:
>
> require 'win32ole'
> x = WIN32OLE.new "Excel.Application"
> x.workbooks.open "sheetwithcyrillicwords.xls"
>
> # this field contains a russian word
> x.range("A1").value # => "???????"
Ruby is probably returning the right values, but you're not displaying
them in Unicode. If you're running on the console, type this before
running your program:
chcp 65001
This will enable the console to behave in UTF-8 mode, which should work.
It would also help if you can see the internal representation of the value:
puts x.range("A1").value.inspect
-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca