|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.cmd.EncodingCmd
public class EncodingCmd
This class implements the built-in "encoding" command in Tcl. It's also the home for the global systemEncoding property, and translates between TCL encoding names and Java Encoding names.
Field Summary | |
---|---|
static String |
systemJavaEncoding
The java equivalent name (either java.nio or java.io/java.lang) of the value returned for 'encoding system' |
static String |
systemTclEncoding
The encoding value set and returned by 'encoding system' |
Constructor Summary | |
---|---|
EncodingCmd()
|
Method Summary | |
---|---|
void |
cmdProc(Interp interp,
TclObject[] objv)
This procedure is invoked to process the "encoding" Tcl command. |
static void |
decodeSymbol(byte[] bbuf,
char[] cbuf,
int off,
int len)
Decode bytes encoded in Tcl's symbol encoding into a character array. |
static byte[] |
encodeSymbol(char[] cbuf,
int off,
int len)
Encode chars into Tcl's symbol encoding into a byte array. |
static int |
getBytesPerChar(String name)
Given a Java encoding name return the average bytes per char |
static String |
getJavaName(String name)
Given a Tcl encoding name, return the Java encoding name |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String systemTclEncoding
public static String systemJavaEncoding
Constructor Detail |
---|
public EncodingCmd()
Method Detail |
---|
public void cmdProc(Interp interp, TclObject[] objv) throws TclException
cmdProc
in interface Command
interp
- the current interpreter.objv
- command arguments.
TclException
- on any errorspublic static int getBytesPerChar(String name)
name
- Java name of encoding as returned from getJavaName(
public static String getJavaName(String name)
name
- Tcl name for encoding
public static void decodeSymbol(byte[] bbuf, char[] cbuf, int off, int len)
bbuf
- binary data that contains a symbol encodes stringcbuf
- character buffer to fill with data soff
- offset to filling cbuflen
- number of characters to add to cbufpublic static byte[] encodeSymbol(char[] cbuf, int off, int len)
cbuf
- character data to encode in 'symbol' encodingoff
- offset to start encodinglen
- number of characters to encode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |