Java UTF8 Encode encodeStringUtf8(String text)

Here you can find the source of encodeStringUtf8(String text)

Description

encode String Utf

License

Open Source License

Declaration

public static String encodeStringUtf8(String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.nio.charset.Charset;

public class Main {
    public static String encodeStringUtf8(String text) {
        return new String(Charset.forName("UTF-8").encode(text).array());
    }//  w  ww .  jav  a2s.co m
}

Related

  1. encodeSignatureUtf8(byte[] sig)
  2. encodeToUTF8(String str)
  3. encodeUtf8(byte[] bytes)
  4. encodeUTF8(byte[] bytes)
  5. encodeUTF8(String str)