octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54391] Incorrect result when attempting to cu


From: Alan W. Irwin
Subject: [Octave-bug-tracker] [bug #54391] Incorrect result when attempting to cut and paste UTF-8 Cyrillic text into octave CLI
Date: Thu, 26 Jul 2018 19:16:33 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.10.1 Chrome/61.0.3163.140 Safari/537.36 Konqueror (WebEnginePart)

URL:
  <http://savannah.gnu.org/bugs/?54391>

                 Summary: Incorrect result when attempting to cut and paste
UTF-8 Cyrillic text into octave CLI
                 Project: GNU Octave
            Submitted by: airwin
            Submitted on: Thu 26 Jul 2018 11:16:31 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

To demonstrate this issue, execute (using cut and paste)

x="Частота"

in the octave CLI.  The result is gibberish text for x, and incorrect values
for the components of x as can be seen from

# The gibberish below comes from the cut and paste attempt
# of the above command
octave:3> x="��ст�т�"
x = ��ст�т�
octave:4> for i = 1:length(x)
> printf("%x\n", x(i));
> endfor
a7
b0
d1
81
d1
82
be
d1
82
b0

If you execute the x assignment in test_cyrillic.m, then you
get the correct result:

test_cyrillic
x
octave:5> test_cyrillic
octave:6> x
x = Частота
octave:7> for i = 1:length(x)
> printf("%x\n", x(i));
> endfor
d0
a7
d0
b0
d1
81
d1
82
d0
be
d1
82
d0
b0

which can be verified (subject to endianess swaps) using od on the bash
command line as follows:

address@hidden> echo "Частота" |od -t x2
0000000 a7d0 b0d0 81d1 82d1 bed0 82d1 b0d0 000a
0000017

Note, I tested "Частота" was valid UTF-8 within the PLplot library
(since that string is used within one of our examples)
and also by converting it using iconv, e.g.,

address@hidden> echo "Частота" |iconv --from-code UTF8 --to-code UTF8
|od -t x2
0000000 a7d0 b0d0 81d1 82d1 bed0 82d1 b0d0 000a
0000017

I think there might be something specially wrong with cut and paste of
Cyrillic for the octave CLI, because I have not encountered these issues with
UTF-8 strings for Mandarin, and UTF-8 strings representing math symbols.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54391>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]