Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » UTF8 encoding
UTF8 encoding [message #198515] Mon, 20 August 2007 12:27 Go to next message
Klaus Schaefers is currently offline Klaus SchaefersFriend
Messages: 24
Registered: July 2009
Junior Member
Hi People,

I'm developing a plugin, that writes xml files. Since I'm not using xerces
or any other xml API I have a problem dealing with Unicode characters. For
instance the german "Ö" will be written like "À". But I need the
decompsoed form like "\u006F". Is there any class in the webtools that
could do this transformation?

Kind regards,

Klaus
Re: UTF8 encoding [message #198537 is a reply to message #198515] Mon, 20 August 2007 22:28 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4501
Registered: July 2009
Senior Member

I don't believe so. I suspect that the decomposed form you've shown
is really just one method supported by various parsers or compilers
to express Unicode characters and not an official representation to
use yourself. I would suggest switching to APIs such as JAXP (found
in Java SE 1.4 and higher) instead of reading and writing files
yourself, or else always reading and writing your files with a
Unicode encoding.

--
Nitin Dahyabhai
Structured Source Editing


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: UTF8 encoding [message #198835 is a reply to message #198515] Thu, 23 August 2007 02:35 Go to previous message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
On Mon, 20 Aug 2007 08:27:32 -0400, Klaus <kschaef@de.ibm.com> wrote:

> Since I'm not using xerces
> or any other xml API I have a problem dealing with Unicode characters. For
> instance the german "Ö" will be written like "À". But I need the
> decompsoed form like "\u006F". Is there any class in the webtools that
> could do this transformation?
>

Just to be sure, you do know you don't need XML APIs to read and write UTF-8, right?
There are plain 'ol Java io API's where you can specify the charset to use.
Also, one step better :) if you are using Eclipse IFile's, they have some capabilities
to automatically detect and use the appropriate charset, depending on the IFile's contentType.

Hope that helps,
Previous Topic:jsp editor doesn't recognize ${var} as using the bean
Next Topic:Launch NewXMLWizard programmatically
Goto Forum:
  


Current Time: Sat Nov 09 03:12:43 GMT 2024

Powered by FUDForum. Page generated in 0.27035 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top