|
From: sfeam <sf...@us...> - 2014-10-29 15:36:54
|
On Tuesday, 28 October 2014 10:45:48 PM Philipp K. Janert wrote: > > I understand that choosing the correct encoding > is important when creating text labels (and so > on) with characters outside the ASCII range. > > But how does gnuplot treat non-ASCII characters > on input, that is, when reading a file in > plot "file" u 3:4 > > I guess it's somewhat of a non-issue, as long as > all the data in the file is numeric - that can > be represented with strict ASCII. > > But what if the file contains string columns - > do they get interpreted differently, based on > set encoding? Yes and no. The individual "words" will get read in and stored no matter what the encoding. But the program needs to know the encoding in order to operate on them properly. For example: set encoding iso_8859_1 # This is wrong test = "αβγδεζηθ" print test # This works because the whole thing is spit out print test[2:2] # This fails because the encoding is wrong print test[3:4] # As does this set encoding utf8 # this fixes it print test[2:2] print test [3:4] > And can I generally rely on > gnuplot to handle multi-byte characters safely > (that is, recognize them as multibyte and store > them accordingly)? UTF8 - yes shift-JIS - I think so but I don't use it myself other - untested > Best, > > Ph. > > > > ------------------------------------------------------------------------------ > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info |