For this kind of operation, it should convert to
utf16 or utf32 where each atom stands for one unicode
codepoint
NB. utf8
a=:'鼠牛虎兔龍蛇馬羊猴鸡狗豬'
NB. utf16
u16=: 7&u: a
NB. utf32
u32=: 9&u: a
Both #u16 and #u32 are 12, so that character operations
can retain our expected semantic.
utf8 is normally what
Lo and behold,conversions work too:
1 (3!:4) A
鼠牛虎兔龍蛇馬羊猴鸡狗豬
2 (3!:4) A
鼠牛虎兔龍蛇馬羊猴鸡狗豬
3 (3!:4) A
鼠牛虎兔龍蛇馬羊猴鸡狗豬
> >> On Wed, Oct 18, 2017 at 1:46 PM, robert therriault
> >> wrote:
> >> >
> >> > Hi David,
> >> >
> >> > You can use {&a. to convert the encoded utf-8 into the characters
> >>
Oh sorry, A is not codepoint.
On Oct 19, 2017 3:15 AM, "bill lam" wrote:
> Will 7 u: A or 8 u: A work?
>
> On Oct 19, 2017 1:58 AM, "Raul Miller" wrote:
>
>> Or,
>>A{a.
>>
>>A{a.
>> 鼠牛虎兔龍蛇馬羊猴鸡狗豬
>>
>> I am not quite sure why u: does not handle A properly, but a
>> workaround there might
Will 7 u: A or 8 u: A work?
On Oct 19, 2017 1:58 AM, "Raul Miller" wrote:
> Or,
>A{a.
>
>A{a.
> 鼠牛虎兔龍蛇馬羊猴鸡狗豬
>
> I am not quite sure why u: does not handle A properly, but a
> workaround there might be to manually convert to utf-16 which u: will
> handle properly.
>
> For example:
>
> ut
Or,
A{a.
A{a.
鼠牛虎兔龍蛇馬羊猴鸡狗豬
I am not quite sure why u: does not handle A properly, but a
workaround there might be to manually convert to utf-16 which u: will
handle properly.
For example:
utf8to16=:3 :0
if. 'literal'-: datatype y do. y=.a.i.y end.
bits=.(8#2)#:y
r=.''
j=.0
while
Hi David,
You can use {&a. to convert the encoded utf-8 into the characters
A=: 16be9 16bbc 16ba0 16be7 16b89 16b9b 16be8 16b99 16b8e
A=:A,16be5 16b85 16b94 16be9 16bbe 16b8d 16be8 16b9b 16b87
A=: 16be9 16bbc 16ba0 16be7 16b89 16b9b 16be8 16b99 16b8e
A=:A,16be5 16b85 16b94 16be9
Hi,
working from the character representation a quick kludge is:
hx=:'\xe9\xbc\xa0\xe7\x89\x9b\xe8\x99\x8e\xe5\x85\x94\xe9\xbe\x8d\xe8\x9b\x87\xe9\xa6\xac\xe7\xbe\x8a\xe7\x8c\xb4\xe9\xb8\xa1\xe7\x8b\x97\xe8\xb1\xac'
a.{~,16 #."1 '0123456789abcdef' i. (,;._1);. _1 hx
鼠牛虎兔龍蛇馬羊猴鸡狗豬
On Wed
http://rosettacode.org/wiki/Chinese_zodiac
The following is supposed to contain strings which look like 12 Chinese
characters.
How in j to have the characters display correctly?
$ python3
Python 3.5.3 (default, Sep 14 2017, 22:58:41)
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "cr
jcs/zmq makes it very easy to use multiple J server tasks.
Early user experience with this has revealed a few obvious (with hindsight)
programming pitfalls for this relatively new kind of use.
Get the update, load addons/net/jcs/jcs.ijs, study warning_jcs_, and run
lab addons/net/jcs/jcs.ijt to g
One other thing to keep in mind is that variables in one J instance
are (mostly) invisible to variables in another J instance.
(I said "mostly" because you can map variables to operating system
files - but this [because of the external dependencies and potential
communication lags] has what may be
10 matches
Mail list logo