473,378 Members | 1,389 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,378 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 17 '05 #1
3 6106
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 17 '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 17 '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 17 '05 #4

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

Similar topics

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...
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....
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"...
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.