Java String Encode encodeStr(String str)

Here you can find the source of encodeStr(String str)

Description

encode Str

License

LGPL

Declaration

public static String encodeStr(String str) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.io.UnsupportedEncodingException;

public class Main {
    public static String encodeStr(String str) {
        try {/*from   w  ww.j  ava  2  s .  c om*/
            return new String(str.getBytes("ISO-8859-1"), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related

  1. encodePath(String str)
  2. encodeRfc5849(final String value)
  3. encodeSpecialMdxCharactersInNames(String name)
  4. encodeState(Map params)
  5. encodeStr(String str)
  6. encodeStr(String t)
  7. encodeString(final String string)
  8. encodeString(OutputStream out, String str)
  9. encodeString(String b)