You are here: DEVPPL Forum Programming Java Forum
NOTIFICATIONS
54.062
MEMBERS
15.677
TOPICS
62.242
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

Custom Controls in JAVA

0

Loading

Postby Achilles » Wed Apr 25, 2007 4:41 pm

Well, I reverse engineered the I18N algorithms for Decoding URLs and came to this package of mine! Enjoy everybody! this is the concept of OPEN SOURCE!!

Code: Select all
/*
 * utf8.java
 *
 * Created on April 23, 2007, 5:17 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package achilles.util;

import java.io.ByteArrayOutputStream;

/**
 *
 * @author MMSaffari
 */
public class utf8{
   
    /** Creates a new instance of utf8 */
    public utf8 () {
    }
   
    public static String getUTF8 (String s){
        String strResult="";
        try{
            byte[] b= s.getBytes ();
            ByteArrayOutputStream baos=new ByteArrayOutputStream (s.length ());
            for (int i = 0; i < b.length; i++) {
                baos.write (b[i]);
            }
            byte[] b2=baos.toByteArray ();
            strResult= new String (b2,0,b2.length,"UTF-8");
        } catch (Exception ex){
            ex.printStackTrace ();
        }
       
        return strResult;
    }
}
:)
Achilles
 
Reputation: 0
Posts: 7
Joined: Thu Apr 19, 2007 4:38 pm
Location: Tehran-Iran
Highscores: 0
Arcade winning challenges: 0

- Sponsored results

Sponsored results

Login to get rid of ads

 

Previous
cron
^ Back to Top