We have some data coming from a database using latin1 encoding (which we
can¹t change).  When we try to insert that data into a libxml doc the
scripts locks up so badly we have to kill the process manually.  If we do a
conversion on the string (String#toutf8) it works.  Setting the encoding of
the document does not help either.

Here is some code,

>> doc = LibXML::XML::Document.new
>> doc.root = LibXML::XML::Node.new("person")
>> doc.root << lname = LibXML::XML::Node.new('last_name')
>> lname << "Farrés"

There is no output from this, it just hangs.  The key to remember is the
"Farrés" is latin1 encoded from MySQL.  If it is UTF-8 the code will work.
The worst part is that it runs right on one server and does not run on
others.  Could there be a library issue?  This is also running under Rails
2.1 if that makes any difference.

Thanks.

Peer Allan
Development Team Lead, e-Business

CanadaDrugs.com
24  Terracon Place
Winnipeg, MB, Canada
R2J  4G7

Phone: (204) 654-7951
Fax:  (204) 654-7910
www.canadadrugs.com

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to