Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTF-8 Support

723605Oct 15 2009 — edited Oct 28 2009
Hello,

I'm trying to send some queries to the dbxml 2.5.14 and I get the following error:
XmlInvalidValue: XmlException 14, Error: checkTrailingBytes: bad utf-8 encoding File: \dbxml-2.5.13\dbxml\src\dbxml\nodeStore\NsUtil.cpp Line: 198

Inside the Queries there are some special german letters [ä,ü,ö,Ä,Ü,Ö].
Importing xml-files with these letters works fine. But using Queries I get the above error.

I looked into the file NsUtil.cpp and for me the UTF-8 Support is well implemented.

I read something about missing UTF-8 Support in the used CommandLine/Shell.
I'm using Win XP and Python 2.5, and they both have UTF-8 Support.

So why do I get this Error??


Thanks for your help.

Comments

723605
Ok, problem just fixed.

I have to encode the query before i send it to the DB

Example:
expression = self.manager.prepare(query.encode("utf-8"), context)
result = expression.execute(context,0)
728731
Hello

I have a similar problem which I cannot manage to solve. I followed your example and wrote:

String expression = "doc('teste.dbxml/ação')";
expression = new String(utf8.encode(expression).array());

but I continue to get the following exception:

com.sleepycat.dbxml.XmlException: Error: Invalid URI format [err:FODC0005], errcode = QUERY_PARSER_ERROR
at com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_1(Native Method)

Can you maybe show your complete solution?

Thank you
Koen

PS: my container teste.dmxl is extremely simple, containing only one document:

dbxml> open teste.dbxml
dbxml> get
1 documents found
dbxml> printn
ação
dbxml> print
*<?xml version="1.0" encoding="UTF-8"?>*
*<ação nome="ação"/>*
655560
Hi,

Please ensure that whether your source code file was saved by UTF-8 encoding.

Thanks,
728731
Hello and thank you for your reply.

I work completely in UTF-8, so yes, my source is saved in UTF-8, but I do not understand what that has to do with the problem.

Can you clarify?
Thank you,
Koen
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 25 2009
Added on Oct 15 2009
4 comments
2,238 views