Fraser, a. or bytes array do not change in J6/J7. The main point is how you or gtkide interpret a byte array. A byte array cannot tell by itself is simple bytes or as utf8 strings. You (not J) assign an interpretation to it.
Your J6 code will continue work so long as they do not display inisde gtkide. if you want display some results, think and make sure they are in correct utf8 or wide unicode format, or use octal_j_ as Crhis suggested. In latin-1 code page, all 256 bytes in a. are legal and a. will have a nice display, but in Chinese or Japanese codepage, displaying a. will be ugly enough. Вск, 05 Фев 2012, Fraser Jackson писал(а): > Thanks Chris and Bill, > > The J alphabet a. is the set of possible byte atoms. The class of 'literal' > nouns permits any sequence of elements of a. J permits remarkable in depth > analysis of any object on a computer because it permits analysis of the > bytes. The j.dll is a string of these atoms. All atoms in the set occur in > j.dll. Some occur much more frequently than others. This may be useless > information, but it is an indicator of the ability of the language to > explore structure at a deep level. > > Utf8 focuses on the transmission of information, not the processing of > information. All of the atoms are important in the processing of the > information and in the ways in which we store the information. > > One can of course use the index in a. to represent any byte. That may > suffice for most purposes, but there are other cases where having a graphic > of some sort really helps as an aide memoire. The table generated below in > J602 is a good start > > marg =: <"0 '0123456789ABCDEF' > (a:,marg),marg,. <"0 (i.16 16){a. > > I would be interested in other alternatives too and some fonts define > characters for a large part of the set of values. > > I will try and look at the octal function with a view to getting closer to > the J602 output. > > Thanks, > > Fraser > > ----- Original Message ----- > From: "chris burke" <cbu...@jsoftware.com> > To: "Programming forum" <programming@jsoftware.com> > Sent: Sunday, February 05, 2012 7:09 PM > Subject: Re: [Jprogramming] Problems displaying the alphabet in J701gtk > andJ701jhs > > > > In J gtk, the session expects data in utf8 format. Obviously a. won't > > work, > > but could be converted to utf8 for display. > > > > The utility that formats data for display is octal_j_. This does a simple > > check on the argument string and either returns it unchanged, or formats > > to > > octal. A simple improvement is to run the formatter on each line, rather > > than the string as a whole, as below: > > > > octal_j_=: 3 : 0 > > t=. ,y > > x=. a. i. t > > n=. x e. 9 10 13 > > m=. n < 32 > x > > if. (isutf8 t) > 1 e. m do. t return. end. > > if. LF e. t do. > > t=. octal each <;._2 t,LF > > }: ; t ,each LF return. > > end. > > r=. t ,"0 1 [ 3 # EAV > > if. #m=. I. m +. x>126 do. > > s=. '\',.}.1 ": 8 (#.^:_1) 255,m{x > > r=. s m} r > > end. > > EAV -.~ ,r > > ) > > > > For example, this works reasonably well with the new definition: > > > > load 'unicode' > > toutf8 &> _16<\a. > > > > On my machine, the first two rows (first 32 chars) are still in octal, but > > the rest get displayed using the proper characters (where available in the > > font). > > > > I would appreciate suggestions for futher improvements to the octal > > utility. > > > > > > On Sun, Feb 5, 2012 at 1:14 PM, bill lam <bbill....@gmail.com> wrote: > > > >> behaviour of < is different if the string is unicode. u: is required in > >> some places and it is not related to simplicity or complexity if you > >> wants correct results. > >> > >> compare the outputs of _16{.a. with u: _16{.a. > >> > >> the first contains illegal utf8 characters which can be checked by > >> isutf8 _16{.a. > >> > >> What would you expect from gtkide to display those illegal characters? > >> > >> Вск, 05 Фев 2012, Fraser Jackson писал(а): > >> > Why should I have to use u: to box elements of a. ? Seems an > >> unnecessary > >> > complication - and a bigger problem for beginners. > >> > > >> > In gtkide <"0 [2}. u: i. 16 16 still has all the problems. That > >> suggests > >> > some problems are associated with the unicode treatment of control > >> > characters. > >> > > >> > Even in Jconsole the first and second line are also irregular.When the > >> > configure specifies a mono spaced font in gtkide we should surely > >> > expect > >> > characters within the ascii set will be treated as atoms and assigned a > >> > single space. > >> > > >> > I am really seeking that members of the alphabet ( and hence any > >> > literal > >> > nouns defined using that set ) have each member treated as an atom and > >> that > >> > that treatment is clearly separated from their role in controlling the > >> > nature of the display. That seems to have been achieved in J602. > >> > > >> > The treatment of type 131072 - unicode obviously involves a host of > >> > other > >> > issues with respect to display and treatment of aoms. However there > >> > are > >> a > >> > large number of problems within the narrower framework of atoms within > >> a. or > >> > represented by those characters. Precise, simple and consistent display > >> of > >> > those atoms is extremely valuable and important and has not yet been > >> > achieved with the gtkide. > >> > > >> > Fraser > >> > ----- Original Message ----- > >> > From: "bill lam" <bbill....@gmail.com> > >> > To: <programming@jsoftware.com> > >> > Sent: Sunday, February 05, 2012 3:04 PM > >> > Subject: Re: [Jprogramming] Problems displaying the alphabet in J701gtk > >> and > >> > J701jhs > >> > > >> > > >> > > It seemes that the characters in the first two rows caused the > >> > > trouble, > >> > > the following display ok in gtkide, > >> > > > >> > > <"0 [ u: 2}. i.16 16 > >> > > > >> > > jconsole have no problem in displaying them. > >> > > > >> > > <"0[u: i.16 16 > >> > > > >> > > >> > ---------------------------------------------------------------------- > >> > For information about J forums see http://www.jsoftware.com/forums.htm > >> > >> -- > >> regards, > >> ==================================================== > >> GPG key 1024D/4434BAB3 2008-08-24 > >> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > >> > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm