Unicode 从右到左的文本
Unicode right-to-left text
采用以下脚本:
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++ 中,数字出现在阿拉伯文本的右侧,而文本出现在左侧。当我尝试将其粘贴到此文本字段中时,出现的是左侧的数字。
谁能解释一下这是怎么回事?
这是由于 Notepad++ 对 RTL 的支持不佳造成的。正确的顺序是:
utf8 with text fooالعربي
utf8 with number 123العربي
Notepad++ 可能认为数字在阿拉伯字符串中,因此它激活了 RTL 并从右侧开始写入。这应该是一个要提交的错误。
解决方法是使用 LTR/RTL 个字符
采用以下脚本:
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++ 中,数字出现在阿拉伯文本的右侧,而文本出现在左侧。当我尝试将其粘贴到此文本字段中时,出现的是左侧的数字。
谁能解释一下这是怎么回事?
这是由于 Notepad++ 对 RTL 的支持不佳造成的。正确的顺序是:
utf8 with text fooالعربي
utf8 with number 123العربي
Notepad++ 可能认为数字在阿拉伯字符串中,因此它激活了 RTL 并从右侧开始写入。这应该是一个要提交的错误。
解决方法是使用 LTR/RTL 个字符