public class InternetCharacterConversion extends Object
Constructor and Description |
---|
InternetCharacterConversion() |
Modifier and Type | Method and Description |
---|---|
static String |
convertByteToString(byte[] bytes)
Converts a byte array from a socket stream into Unicode.
|
static String |
convertByteToString(byte[] bytes,
int pos,
int length)
Converts a byte array from a socket stream into Unicode.
|
static byte[] |
convertStringToByte(String string)
Converts a string to a byte array for a socket stream.
|
static byte[] |
convertToHTMLString(byte[] bytes)
Converts a byte array to a HTML string with "&symbol;".
|
static byte[] |
convertToHTMLString(String s)
Converts a string to a HTML string with "&symbol;".
|
static byte[] |
convertToXMLString(byte[] bytes)
Converts a byte array to an XML string.
|
static byte[] |
convertToXMLString(String s)
Converts a String to an XML string as a byte array.
|
static String |
getCodepageString()
Gets the name of the codepage, e.g.
|
static boolean |
setCodepage(String cp)
Sets the new codepage conversion codepage.
|
static String |
stringConvertToHTMLString(String s)
Converts a string to a HTML string with "&symbol;".
|
static String |
stringConvertToXMLString(String s)
Converts a String to an XML string.
|
static Hashtable<String,String> |
urlDecode(byte[] data)
A HTML form MIME type reply.
|
static String |
urlDecode(String urlString)
A HTML form MIME type string.
|
public static final String hexes
public static boolean setCodepage(String cp)
public static String getCodepageString()
public static String convertByteToString(byte[] bytes)
public static String convertByteToString(byte[] bytes, int pos, int length)
public static byte[] convertStringToByte(String string)
public static byte[] convertToHTMLString(byte[] bytes)
public static byte[] convertToHTMLString(String s)
public static String stringConvertToHTMLString(String s)
public static byte[] convertToXMLString(byte[] bytes)
public static String stringConvertToXMLString(String s)
public static byte[] convertToXMLString(String s)
public static String urlDecode(String urlString)
java.net.URLEncoder.encode
method, decoded with the InternetCharacterConversion.urlDecode
method.
Note that this method will not handle the "&" sign, so the string must be tokenized
prior to calling this method.
This utility method decodes a String from a MIME format called "x-www-form-urlencoded" format into a normal String.
To convert a String to the encoded form, each character is examined in turn:
MimeTypes.HTML_FORM_REPLY_MIME_TYPE
public static Hashtable<String,String> urlDecode(byte[] data)
java.net.URLEncoder.encode
method, decoded with the InternetCharacterConversion.urlDecode
method.
This utility method decodes a byte array from a MIME format called "x-www-form-urlencoded" format a series of name/value pairs in a hash table. If several names exist, the last one is retained.
Note: The case of the name string is retained. The name string is however trimmed of any spaces.
MimeTypes.HTML_FORM_REPLY_MIME_TYPE
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.