Android Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingAndroid Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 30th, 2013, 08:15 AM
danProg1 danProg1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 1 danProg1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 7 sec
Reputation Power: 0
Problem displaying xml utf8 symbols on edittext

i have the following project that recieve xml from the client
but hebrew text displayed wronggly


public void run1() {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("my https url");

try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("key",mykey));

StringEntity se = new UrlEncodedFormEntity(nameValuePairs);
httppost.setEntity(se);

httppost.addHeader("Content-Type","application/x-www-form-urlencoded");

ResponseHandler<String> responseHandler = new BasicResponseHandler();
String httpResponse=httpclient.execute(httppost, responseHandler);

//stripping from xml the info between <hebrew_val>אבגדה</hebrew_val>
String[] separated1 = httpResponse.split("</hebrew_val>");
String[] separated2 = separated1[0].split("<hebrew_val>");

String finalString = URLEncoder.encode(separated2[1], "UTF-8");

edt.setText(separated2[1]);
Log.d("encoding", separated2[1]);
Log.d("encoding", finalString);


} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

logcat display
01-30 15:22:36.251: D/encoding(9506): אדם שווץ
01-30 15:22:36.251: D/encoding(9506): %C3%97%C2%90%C3%97%C2%93%C3%97%C2%9D+%C3%97%C2%97%C2%95%C3%97%C2%A8%C3%97%C2%A5

any help appriciated

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingAndroid Development > Problem displaying xml utf8 symbols on edittext

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap