哪位大侠对unicode有研究啊 从0x0000到0xffff 哪些是没有定义过的不可以使用的 急需 谢谢帮助
解决方案 »
- button或者imageview按下的时候变小,松开后还原 急急急。。在线等。
- 新手求指导。在相机里面有地理位置菜单(点击有开和关),想知道要怎么去掉这个菜单。
- gallery和ImageSwitcher显示网络图片问题
- android实现延时响铃遇到的问题(100分求助)
- 关于监测数据库SQLite的变化
- Android初学者的学习笔记(陆续更新)
- 不使用R.class如何使用资源文件
- 屏幕高度
- 急急急,Listview如何只更新新加的数据
- 求助大佬们,android studio创建一个项目出错handshake_failure
- android 触屏事件的问题
- android的ilbc编码问题
可是却是由不支持的
典型代码如下message="中国中国123456789";int i;
byte[] unicodebyte = null;
try {
unicodebyte = message.getBytes("unicode");
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
unicodebyte[18] = (byte)-48;
unicodebyte[19] = (byte)-33;
try {
message = new String(unicodebyte, "unicode");
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
unicodebyte = message.getBytes("unicode");
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}可以看到unicodebyte错了问题还是:怎么知道哪些字符是非法字符?
android里面应该有个表可以查到的,不知道怎么看这个数据
* Decodes one or more bytes. The default behaviour of the converter
* is stop and report if an error in input stream is encountered.
* To set different behaviour use @see CharsetDecoder.onMalformedInput()
* This method allows a buffer by buffer conversion of a data stream.
* The state of the conversion is saved between calls to convert.
* Among other things, this means multibyte input sequences can be
* split between calls. If a call to convert results in an Error, the
* conversion may be continued by calling convert again with suitably
* modified parameters.All conversions should be finished with a call to
* the flush method.
* @param in buffer to decode
* @param out buffer to populate with decoded result
* @return result of decoding action. Returns CoderResult.UNDERFLOW if the decoding
* action succeeds or more input is needed for completing the decoding action.
* @stable ICU 2.4
*/
protected CoderResult decodeLoop(ByteBuffer in,CharBuffer out){ if(!in.hasRemaining()){
return CoderResult.UNDERFLOW;
} data[INPUT_OFFSET] = getArray(in);
data[OUTPUT_OFFSET]= getArray(out);
data[INPUT_HELD] = 0;
try{
/* do the conversion */
ec=NativeConverter.decode(
converterHandle, /* Handle to ICU Converter */
input, /* input array of bytes */
inEnd, /* last index+1 to be converted */
output, /* input array of chars */
outEnd, /* input index+1 to be written */
data, /* contains data, inOff,outOff */
false /* donot flush the data */
);到了这里 进不去了