Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 13th, 2007, 07:47 AM
mohab mohab is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 3 mohab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m
Reputation Power: 0
Unhappy Problem in encoding utf-8

hi all
i had a problem in converting String that contain text in utf-8 encoded, and i want to encode it to (Cp1256) which is arabic windows

i tried this
String x="%D8%A3"; \\this is utf-8 encoded
fieldValue=new String(x.getBytes"UTF8"),"iso8859_1");

it doesnt work, i dont know why
please help me to solve that problem

Reply With Quote
  #2  
Old March 25th, 2007, 06:39 AM
mohab mohab is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 3 mohab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m
Reputation Power: 0
Angry Why No one Answers me, 71 views and 0 replay?!!!!!!

Quote:
Originally Posted by mohab
hi all
i had a problem in converting String that contain text in utf-8 encoded, and i want to encode it to (Cp1256) which is arabic windows

i tried this
String x="%D8%A3"; \\this is utf-8 encoded
fieldValue=new String(x.getBytes"UTF8"),"iso8859_1");

it doesnt work, i dont know why
please help me to solve that problem

Reply With Quote
  #3  
Old March 27th, 2007, 05:42 PM
daniel_g daniel_g is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 60 daniel_g User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 3 m 50 sec
Reputation Power: 3
Perhaps no1 here knows how to do that, plus you haven't specifed what errors you are getting(they tell you a lot about what's going on, and posting them would be a good idea). However, from what I see, I can tell you that your code is missing a (
Code:
fieldValue=new String(x.getBytes"UTF8"),"iso8859_1");

should be
Code:
fieldValue=new String(x.getBytes("UTF8"),"iso8859_1");

Hope this helps.

Last edited by daniel_g : March 27th, 2007 at 05:46 PM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Problem in encoding utf-8


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT