Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.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
Perl Unicode从右向左文本_Perl_Unicode_Arabic - Fatal编程技术网

Perl Unicode从右向左文本

Perl Unicode从右向左文本,perl,unicode,arabic,Perl,Unicode,Arabic,以下面的脚本为例: use strict; use warnings; use feature 'say'; my $utf8 = "العربي"; open my $out,">","out.txt"; say {$out} "utf8 with text foo".$utf8; say {$out} "utf8 with number 123".$utf8; 我不明白文本的方向性会发生什么。在Notepad++中,数字显示在阿拉伯语文本的右侧,而文本显示在左侧。当我试着将它粘贴

以下面的脚本为例:

use strict;
use warnings;
use feature 'say';

my $utf8 = "العربي";
open my $out,">","out.txt";

say {$out} "utf8 with text foo".$utf8;
say {$out} "utf8 with number 123".$utf8;
我不明白文本的方向性会发生什么。在Notepad++中,数字显示在阿拉伯语文本的右侧,而文本显示在左侧。当我试着将它粘贴到这个文本字段中时,它的左边有一个数字


有人能解释发生了什么吗?

这是由于记事本++中对RTL的错误支持造成的。正确的顺序是:

utf8 with text fooالعربي
utf8 with number 123العربي
记事本++可能认为数字在阿拉伯字符串中,因此它激活了RTL并开始从右侧写入。这应该是一个错误提交


解决方法是使用LTR/RTL字符

谢谢。我现在可以通过在英语和阿拉伯语文本之间添加LTR字符(unicode U200E)来解决这个问题