Re: PHP - Convert unicode to hex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi abishek,
this is not the exact solotuin to ur problem but can give some idea to
proceed
this is a sample java code to convert string to hex

  /**
          * Convert a String to Hexa decimal form.
          */
           import java.io.*;

           class StringToHexConvert {

                  String stringToHex(String str) {
                          char[] chars = str.toCharArray();
                          StringBuffer strBuffer = new StringBuffer();
                          for (int i = 0; i < chars.length; i++) {
                                  strBuffer.append(Integer.toHexString((int)
chars[i]));
                          }
                          return strBuffer.toString();
                  }

                  public static void main(String[] args) throws IOException
{
                          System.out.print("Enter the String : ");
                          BufferedReader br =new BufferedReader(new
InputStreamReader(System.in));
                          String inputString = br.readLine();
                          StringToHexConvert obj = new StringToHexConvert();
                          String hexString = obj.stringToHex(inputString);
                          System.out.println("String in hexa form : " +
hexString);
                  }
             }



i know u want hindi to hex code
when i got the solution to convert hindi to englist string i will mail it to
u

bye


[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux