tolower and toupper in stdlib is not unicode compatible. eg
   toupper 3 2$'aBc' , (u:39321 28207), 'E'
|index error: toupper
|       toupper 3 2$'aBc',(u:39321 28207),'E'

and it is not always possible to convert to utf8 for processing
   utf8 3 2 $ 'aBc' , (u:39321 28207), 'E'
|rank error: utf8
|       utf8 3 2$'aBc',(u:39321 28207),'E'

alternatively it might redefine them as

'l u'=. (a.i.'aA') +each <i.26
tolower0=: a.&i. { ((l{a.) u} a.)"_
toupper0=: a.&i. { ((u{a.) l} a.)"_
ascsub=: 1 : 0
msk=. (128 > 3&u:) y1=. ,y [ s=. $y
s $ (u msk#y1) (I.msk)}y1
)
tolower=: tolower0 ascsub
toupper=: toupper0 ascsub

   toupper 3 2$'aBc' , (u:39321 28207), 'E'
AB
C香
港E

-- 
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to