admin 管理员组文章数量: 887032
2023年12月19日发(作者:dim函数r语言)
} else if (head[0]==-2 && head[1]==-1) {
inputCode = "UTF-16BE"; } else { left0 = head; counter++; } } while((len=(buffer)) == segmentSize) { //to check the value of len// n("len = " + len); int i = segmentSize - 1; if ("UTF-16LE".equals(inputCode)) { while (i>-1) { if ((buffer[i-1] >= 0 && buffer[i-1] <= 127) && buffer[i] ==0) { break;} i--; if (i==0) { //报错 n("File Segmentation Failed. Failed to find an " + "ASCII character(0x0000-0x0009) in a segment size of "+ segmentSize +" bytesn"+"Plese adjust the segmentation size."); break; } }// i = segmentSpliter(buffer,"(buffer[i-1] >= 0 || buffer[i-1] <= 127) "// + "&& (buffer[i]==0)"); }else if ("UTF-16BE".equals(inputCode)) { while (i>-1) { if ((buffer[i] >= 0 && buffer[i] <= 127) && buffer[i-1] ==0) { break;} i--; if (i==0) { //报错 n("File Segmentation Failed. Failed to find an " + "ASCII character(0x0000-0x0009) in a segment size of "+ segmentSize +" bytesn"+"Plese adjust the segmentation size."); break; } } }else {// the following segmentation method is not suitable for UTF-16 or UTF-32
// since they are not compatible with ASCII code
while (i>-1) { if (buffer[i] <= 127 && buffer[i] >= 0) { break;} i--; if (i==0) { //报错 n("File Segmentation Failed. Failed to find an " + "ASCII character(0-127) in a segment size of "+ segmentSize +" bytesn"+"Plese adjust the segmentation size."); break; } } } validBuffer = (buffer, i+1); if (counter%2==0){ left0 = Range(buffer,i+1,segmentSize); combined = concat(left1,validBuffer); left1 = null; } else { left1 = Range(buffer,i+1,segmentSize); combined = concat(left0,validBuffer); left0 = null; } counter++; converted = realConvert2(combined,); (converted); } //for the end part of the document //can't use len=(buffer) since buffer has been read into in the while loop for the last time. if(len < segmentSize) { //to check the value of len n("len = " + len); if (len>0) { validBuffer = (buffer, len); } else { //in case the file length is the multiple of 8 //in this case, the length of last segment will be 0 //only need to write what's in the left0 or left1 validBuffer = null; }
版权声明:本文标题:中文乱码、英文数字正常,所有编码都试过了还是不能正常显示的解决办法 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1702977927h438196.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论