中文乱码、英文数字正常,所有编码都试过了还是不能正常显示的解决办法

阅读: 评论:0

2024年2月3日发(作者:)

中文乱码、英文数字正常,所有编码都试过了还是不能正常显示的解决办法

} 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; }

中文乱码、英文数字正常,所有编码都试过了还是不能正常显示的解决办法

本文发布于:2024-02-03 15:08:20,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170694410150713.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:数字   解决办法   显示
留言与评论(共有 0 条评论)
   
验证码:
排行榜

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23