Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » UTF8 encoding
UTF8 encoding [message #198515] Mon, 20 August 2007 08:27 Go to next message
Eclipse UserFriend
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 18:28 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: UTF8 encoding [message #198835 is a reply to message #198515] Wed, 22 August 2007 22:35 Go to previous message
Eclipse UserFriend
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: Tue Jul 15 21:16:28 EDT 2025

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

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

Back to the top