Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Decoding the string

Reply
Thread Tools

Decoding the string

 
 
sumit sumit is offline
Junior Member
Join Date: Mar 2012
Posts: 7
 
      03-10-2012
Hi ,
i am trying to encode a string using getByte() in byte , UTF 8 and ISO code but i am not capable to decode that code to get original string so can any please help me to get original string by decoding any one of the byte,UTF or ISO code.
My code is
import java.io.*; public class Test{ public static void main(String args[]){ String Str1 = new String("Welcome to Tutorialspoint.com"); try{ byte[] Str2 = Str1.getBytes(); System.out.println("Returned Value " + Str2 ); Str2 = Str1.getBytes( "UTF-8" ); System.out.println("Returned Value " + Str2 ); Str2 = Str1.getBytes( "ISO-8859-1" ); System.out.println("Returned Value " + Str2 ); }catch( UnsupportedEncodingException e){ System.out.println("Unsupported character set"); } } }OUTPUT is
Returned Value [B@192d342 Returned Value [B@15ff48b Returned Value [B@1b90b39
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am facing an issue while decoding json string using json.loads sajuptpm Python 2 12-28-2012 07:16 AM
String Manipulation Problems (decoding hex) Oreo Shake Ruby 4 01-28-2010 08:26 PM
Problem with decoding a compressed string keith_g Ruby 1 12-03-2007 02:53 AM
Decoding string Sonnich Javascript 1 10-11-2006 05:26 PM
query string encoding/decoding =?Utf-8?B?TWFyaw==?= ASP .Net 7 04-05-2004 04:02 PM



Advertisments