Topic: Encoding problem when reading file.xml
Hi,
I'm running
C:\tmp\dubbel>jruby -v
jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) Client VM 1.6.0_33-b03 [Windows 7-x86]I've problem parsing xml files on disk.
/path/to/file.xml (is created in notepad++ and is utf-8 encoded)
<?xml version="1.0" encoding="UTF-8"?>
<root>LÖök</root>From CMD
puts open('/path/to/file.xml').read
<?xml version="1.0" encoding="UTF-8"?>
<root>L├û├Âk</root>This cause problem when I load the file into Nokogiri
Nokogiri::XML open('/path/to/file.xml').read
I've also tried
Encoding.default_external = 'utf-8'
File.open(fpath, 'r:utf-8') do |f|
puts f.read
endbut I still have an encoding problem
Any suggestions on how to solve this appriciated
thanks
-Dan