Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/192.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法拆分混合拉丁语和;android中文件中的阿拉伯文字符串_Android_Split_Arabic_Utf_Latin - Fatal编程技术网

无法拆分混合拉丁语和;android中文件中的阿拉伯文字符串

无法拆分混合拉丁语和;android中文件中的阿拉伯文字符串,android,split,arabic,utf,latin,Android,Split,Arabic,Utf,Latin,需要分析此文件(混合拉丁语和阿拉伯语): 1|حِِمِ 2 |المِِنَ 该文件在notepad++中保存为UTF8,并放在android资产文件夹中。 预期结果:对于第1行,条目为“1”和“حِِمِ”(按“|”分割) 实际结果: 列[0]=“1”可以,但 列[1]=“D8%AD%D9…”不正常,应为“حِيمِ”。 如何解决这个问题,还是有更好的方法?请帮忙。提前感谢。已解决,更改: while ((line = buffer.readLine()) != null) {

需要分析此文件(混合拉丁语和阿拉伯语):

1|حِِمِ
2 |المِِنَ

该文件在notepad++中保存为UTF8,并放在android资产文件夹中。
预期结果:对于第1行,条目为“1”和“حِِمِ”(按“|”分割)

实际结果:
列[0]=“1”可以,但
列[1]=“D8%AD%D9…”不正常,应为“حِيمِ”。
如何解决这个问题,还是有更好的方法?请帮忙。提前感谢。

已解决,更改:

    while ((line = buffer.readLine()) != null) {
        String lineEnc = URLEncoder.encode(line, "UTF-8");
        String[] columns = lineEnc.split("%7C");
进入

    while ((line = buffer.readLine()) != null) {
        String lineEnc = URLEncoder.encode(line, "UTF-8");
        String[] columns = lineEnc.split("%7C");
    while ((line = buffer.readLine()) != null) {
        String[] columns = line.split("\\|");