473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

JAXB and Arabic encoding

Hello,

I'm using JAXB to export/import data from/to a DB through XML files.
Everything is working well. I would like also to be able to edit
the file using an editor, typically XMLSpy. The problem is that
within the XML the arabic text is encoded with strings such as
"& #1578;& #1575;& #1585"... and using the editor, arabic does not
appear, only the sequence of ascii strings i just mentioned. I edit
manually and replace with arabic charater, then they show up in
XMLSpy. I guess it's an encoding problem at marshalling ?

I've tried anything I can at the marshalling step using :
Marshaller m = jc.createMarshaller();
m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
m.setProperty( Marshaller.JAXB_ENCODING, "ISO-8859-6" );
m.marshal(xmldata, new FileOutputStream(xmlfile));


still the same thing. tries UTF-8, CP1256, Windows-1256, ...

Is there a way to have arabic charaters directly showing up in
the XML ?

Thank you for any help

Brahim.
Jul 20 '05 #1
3 3843
Brahim Machkour wrote:
Hello,

I'm using JAXB to export/import data from/to a DB through XML files.
Everything is working well. I would like also to be able to edit
the file using an editor, typically XMLSpy. The problem is that
within the XML the arabic text is encoded with strings such as
"& #1578;& #1575;& #1585"... and using the editor, arabic does not
appear, only the sequence of ascii strings i just mentioned. I edit
manually and replace with arabic charater, then they show up in
XMLSpy. I guess it's an encoding problem at marshalling ?

I've tried anything I can at the marshalling step using :

Marshaller m = jc.createMarshaller();
m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
m.setProperty( Marshaller.JAXB_ENCODING, "ISO-8859-6" );
m.marshal(xmldata, new FileOutputStream(xmlfile));

still the same thing. tries UTF-8, CP1256, Windows-1256, ...

Is there a way to have arabic charaters directly showing up in
the XML ?

Thank you for any help

Brahim.


You have to use a 'transcoder' which knows what characters can be
represented directly in the selected encoding. Many transcoders will
take the easy way out and just put everything not in ASCII as a
character reference. Note that prior to the addition of the Charset
classes in 1.4 it was tedious to determine if a given character set
supported a character.

Mark Thornton

Jul 20 '05 #2
On Sat, Jul 26, Roedy Green inscribed on the eternal scroll:
If they did, it would not be XML any more. XML is designed to make
handling un-American characters difficult.


Bloody trolls.
Jul 20 '05 #3
Roedy Green wrote:
On 25 Jul 2003 01:25:54 -0700, bm*******@yahoo.com (Brahim Machkour)
wrote or quoted :

Is there a way to have arabic charaters directly showing up in
the XML ?

If they did, it would not be XML any more. XML is designed to make
handling un-American characters difficult.

Not at all.

The one thing an XML parser must support to claim it is an XML parser is
Unicode.

Just Use UTF-8 on the XML file and view it in Notepad. You can even have
Arabic identifiers.

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Brahim Machkour | last post by:
Hello, I'm using JAXB to export/import data from/to a DB through XML files. Everything is working well. I would like also to be able to edit the file using an editor, typically XMLSpy....
0
by: Mark | last post by:
I'm betting it me. Here is the simple schema I'm using: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"...
2
by: zahid | last post by:
Hello, Dear Friends, I have to make such type of interface,you can say it a html form. in which a admin can write arabic data and can insert that data or recordsin database in ASP. and i have to...
13
by: Christoph Brunner | last post by:
Hi, on the sun homepage i had submit to the bugparade a request for feature enhancement for the JAXB API. After a period of time sun called me to post my request to a newsgroup an get comments...
0
by: Mark | last post by:
I'm betting it me. Here is the simple schema I'm using: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"...
3
by: suhaddad | last post by:
I have an XML schema that I want to modify. I need to change the text from English to Arabic, but I can't seem to be able to do so. <LearningResourceData Type="Session - Tutorial and Workouts">...
17
by: thinkfirst | last post by:
Hello CIWAH ... I want to propose full internationalization of three related websites: http://africadatabase.org/ http://people.africadatabase.org/ http://institutions.africadatabase.org/ My...
4
by: Greg | last post by:
I'm having trouble displaying and passing arabic characters from my web form. I've added requestEncoding="windows-1256" responseEncoding="windows-1256" to my web.config but it didn't help. I also...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
0
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.