I implemented the temporarily solution, that encoeds the string back into
UTF-8 2-byes format.


protected String convertToUTF8( String s ) throws Exception {


HashMap hm = new HashMap(18);

hm.put("ą", new byte[]{ (byte)196, (byte) 133 });

hm.put("ż", new byte[]{ (byte)197, (byte) 188 });

hm.put("ź", new byte[]{ (byte)197, (byte) 186 });

hm.put("ć", new byte[]{ (byte)196, (byte) 135 });

hm.put("ń", new byte[]{ (byte)197, (byte) 132 });

hm.put("ł", new byte[]{ (byte)197, (byte) 130 });

hm.put("ó", new byte[]{ (byte)195, (byte) 179 });

hm.put("ę", new byte[]{ (byte)196, (byte) 153 });

hm.put("ś", new byte[]{ (byte)197, (byte) 155 });

hm.put("Ą", new byte[]{ (byte)196, (byte) 132 });

hm.put("Ż", new byte[]{ (byte)197, (byte) 187 });

hm.put("Ź", new byte[]{ (byte)197, (byte) 185});

hm.put("Ć", new byte[]{ (byte)196, (byte) 134 });

hm.put("Ń", new byte[]{ (byte)197, (byte) 131 });

hm.put("Ł", new byte[]{ (byte)197, (byte) 129});

hm.put("Ó", new byte[]{ (byte)195, (byte) 147});

hm.put("Ę", new byte[]{ (byte)196, (byte) 152});

hm.put("Ś", new byte[]{ (byte)197, (byte) 154});


Iterator it = hm.keySet().iterator();

String key;



while( it.hasNext()) {

key = (String)it.next();

//System.out.println("Replace : " + key);

s = StringUtils.replace(s, key, new String( (byte []) hm.get(key),
"UTF-8" ) );

}


return s;


}



To adopt it for your system you should replace the codes for you language
(spanic, portugese ?). Very helpfull is this site:

http://www.stanford.edu/~hc10/misc/binhexuni.html

I also used the StringUtils class for Jakarta Commons Lang package.

sincerely Olek

----- Original Message ----- 
From: "HHDirecto.Net" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, October 31, 2006 12:03 PM
Subject: Re: Axis 1.4: Send dont't send string in UTF-8


yes, maybe the same problem. Anyone knows about it?


2000/10/31, Filozof71 <[EMAIL PROTECTED]>:
>
> Hello,
>
> I have similar problem but I am not sure the same as yours. I put into
> response XML properly encoded 2-byte UTF-8 characters that get
> automatically
> encoded in HTML style &#x<code>;
>
> This is the same as yours ?
>
> sincerely Olek
>
>
>
> ----- Original Message -----
> From: HHDirecto.Net
> To: [email protected]
> Sent: Tuesday, October 31, 2006 10:29 AM
> Subject: Axis 1.4: Send dont't send string in UTF-8
>
>
> My axis 1.4 WS don't return strings as utf-8.
>
> This is the response when I do:
>
> return "c iñigín nº 3";
>
>
> <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance
> "><soapenv:Body><damestringResponse
> xmlns="http://interfazweb.serviciosweb.xxx.com "><damestringReturn>c
> i&#xF1;ig&#xED;n n&#xBA;
>
>
3</damestringReturn></damestringResponse></soapenv:Body></soapenv:Envelope>
>
> Thanks in advance!!
>
>
>
> ----------------------------------------------------------------------
> PS. >>> http://link.interia.pl/f19a6
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to