Ronan Reilly wrote: > I'm trying to display some German text using plot (J601). The text has been > read in from a file using fread, decoded using ". , and stored in a table. > > When I extract a word with an umlaut from the table (e.g., Aktualität), > assign it to W1, and plot it using > > pd 'reset;text 0 _1x ',W1,';show' > > the letter with an umlaut does not display correctly. > > However, if I evaluate W1 in the jwd, like so: > > W1 > Aktualität > > and then edit and evaluate it like so > > W2 =: Aktualität > > and then display W2 using > > pd 'reset;text 0 _1x ',W2,';show' > > W2 displays correctly. > > Also > > $W1 > 10 > $W2 > 11 > > What is going on here? How can I display the unicode characters using plot?
In general, J assumes incoming text is in utf8 format. J also supports a "unicode" data type, which is 2-byte unicode, see the help for u: . Text as either utf8 or unicode will display correctly in the session, but only utf8 will work in plot. In this example, W2 is in utf8 format, and W1 in 2-byte unicode. You need to convert W1 to utf8, using the utf8 verb. Here is what is happening: #W2=: 'Aktualität' 11 #W1=: ucp W2 10 W2 -: utf8 W1 datatype W2 literal datatype W1 unicode a.i.W2 65 107 116 117 97 108 105 116 195 164 116 a.i.W1 65 107 116 117 97 108 105 116 228 116 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
