public interface IStringCustomizer
Here is an example of an implementation.
import quadbase.ChartAPI.*; import quadbase.util.*; // This is an example of a user implemented class of IStringCustomizer public class StrCustomizer implements IStringCustomizer { // default constructor public void StrCustomizer() { } // this is the only method that users need to implement // method takes in a String argument and returns a "formatted" String public String encodeString(String str) { try { // Convert this String into bytes according to the specified // character encoding, storing the result into a new byte array. byte[] bytes = str.getBytes("8859_1"); // Construct & return a new String by converting the specified // array of bytes using the specified character encoding. return new String(bytes, "SJIS"); } catch (java.io.UnsupportedEncodingException e) { ex.printStackTrace(); } // return null if conversion is un-successful return null; } }
Modifier and Type | Method and Description |
---|---|
java.lang.String |
encodeString(java.lang.String str)
This method takes in a String in the original format(non-ASCII), and returns a String in the
new format(ASCII).
|