beasy
beasy

Reputation: 1227

Unicode right-to-left text

Take the following script:

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;

I don't understand what happens with the directionality of the text. In Notepad++, the number comes out on the right side of the Arabic text, while text comes out at the left. When I tried pasting it into this text field, it came out with the number on the left.

Can anyone explain what is happening?

Upvotes: 1

Views: 252

Answers (1)

Assem
Assem

Reputation: 12077

This is caused by the bad support for RTL in Notepad++. The right order is that:

utf8 with text fooالعربي
utf8 with number 123العربي

Notepad++ might think that the numbers are within the Arabic string so it activated the RTL and started to write from the right. This should be a bug to submit.

A workaround is to use LTR/RTL characters

Upvotes: 2

Related Questions