[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf() |
Date: |
Sun, 17 Dec 2017 14:29:50 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #3, bug #52681 (project octave):
There is a routine called textread() that comes close, but it still has some
flakiness. For example, the following gives the appearance of working:
octave:33> [a b c] = textread ('p1.txt',"%s %s %s")
warning: range error for conversion to character value
warning: called from
textread at line 162 column 14
a =
{
[1,1] = País
[2,1] = Chipre
[3,1] = Dinamarca
[4,1] = Atenas
[5,1] = España
[6,1] =
}
b =
{
[1,1] = Capital
[2,1] = Nicosia
[3,1] = Copenhague
[4,1] = Grecia
[5,1] = Madrid
[6,1] =
}
c =
{
[1,1] = Población
[2,1] = 300000
[3,1] = 509861
[4,1] = 745414
[5,1] = 3250645
[6,1] =
}
but try reading just the header, and the UTF seems lost:
octave:34> [a b c] = textread ('p1.txt',"%s %s %s", 1)
warning: range error for conversion to character value
warning: called from
textread at line 162 column 14
warning: range error for conversion to character value
warning: called from
textread at line 236 column 9
a =
{
[1,1] = Pas
}
b =
{
[1,1] = Capital
}
c =
{
[1,1] = Poblacin
}
But this sort of works:
octave:38> [a b c] = textread ('p1.txt',"%s %s %d", "headerlines", 1)
warning: range error for conversion to character value
warning: called from
textread at line 162 column 14
a =
{
[1,1] = Chipre
[2,1] = Dinamarca
[3,1] = Atenas
[4,1] = España
[5,1] =
}
b =
{
[1,1] = Nicosia
[2,1] = Copenhague
[3,1] = Grecia
[4,1] = Madrid
[5,1] =
}
c =
300000
509861
745414
3250645
0
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52681>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), anonymous, 2017/12/16
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Markus Mützel, 2017/12/16
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Dan Sebald, 2017/12/17
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(),
Dan Sebald <=
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Andreas Weber, 2017/12/17
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Dan Sebald, 2017/12/17
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Markus Mützel, 2017/12/17
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Dan Sebald, 2017/12/17
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Dan Sebald, 2017/12/17
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Dan Sebald, 2017/12/17
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Markus Mützel, 2017/12/21
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Dan Sebald, 2017/12/21
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Markus Mützel, 2017/12/22
- [Octave-bug-tracker] [bug #52681] Bad reading for UTF-8 characters with fscanf(), Markus Mützel, 2017/12/23