You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Qian Li <qi...@googlemail.com> on 2007/11/22 16:10:22 UTC

How to convert int unicode to character/String

Hi,

Currently I have a org.apache.batik.dom.events.DOMKeyEvent, I can use
getCharCode() to get the input value, however it's in int value, does
anyone know how I can convert this value into the actual
character/String.

Thank you very much for help.

Kind regards,
Qian

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: How to convert int unicode to character/String

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Qian.

Qian Li:
> Currently I have a org.apache.batik.dom.events.DOMKeyEvent, I can use
> getCharCode() to get the input value, however it's in int value, does
> anyone know how I can convert this value into the actual
> character/String.

The value returned by getCharCode() is the Unicode character.  This
means that you can just cast it to a char:

  DOMKeyEvent evt = …;
  char c = (char) evt.getCharCode();

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org