汉字/UTF-8的转码和解码

String string = "诺基亚";
        String eStr = null;
  try {
   eStr = URLEncoder.encode(string, "utf-8");
  } catch (UnsupportedEncodingException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
        Log.e("",eStr);
        try {
         Log.e("",URLDecoder.decode(eStr, "utf-8"));
  } catch (UnsupportedEncodingException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }

你可能感兴趣的:(String,null)