At the time of SetB/GetB there might not even
been Unicode type in J, since then there's now
UTF-8 possibility over discarding upper byte.
For example,

SetB COM -> J
BYTE[] Literal array (as is)
BSTR   Literal array (as UTF-8)

GetB COM <- J
BSTR   Literal array (as UTF-8)
BSTR   Unicode


Set  COM -> J
BYTE[] Literal array (as is)
BSTR   Unicode

Get  COM <- J
BYTE[] Literal array (as is)
BSTR   Unicode

(Or something similar, but having ability
to pass Unicode and UTF-8 without losing upper bytes.)

Arrays of BSTRs could be mapped to arrays of boxed
strings. (Same as arrays of VARIANTs are recursively
boxed.) Because this is a frequent thing and different
from the latter.

As Alex pointed out here's the related URL:
http://www.jsoftware.com/jwiki/Guides/.NET_Interop#head-dfa1a49795479b47f02c6c0a7fe408a9096e83c1


--- Eric Iverson <[EMAIL PROTECTED]> wrote:

> The request for GetB and SetB to support widechar data is reasonable. I will 
> try to fit it in to the final 602.
> 
> ----- Original Message ----- 
> From: "Alex Rufon" <[EMAIL PROTECTED]>
> To: "Programming forum" <[email protected]>
> Sent: Thursday, October 18, 2007 11:55 AM
> Subject: RE: [Jprogramming] unicode string inside arrays
> 
> 
> > @Bill,
> >
> > Thanks for the xml suggestion, I would definitely take it into 
> > consideration.
> >
> > @Eric,
> >
> > I know you have a lot on your plate right now with the latest version in 
> > beta status. I would just like to request, if you have some time, to look 
> > into improving GetB() and SetB() function to support widechar Unicode. I 
> > know that a lot of people would benefit from this particularly for us 
> > who's in the Asian region.
> >
> > Thanks and I am still open to suggestions regarding this problem.
> >
> > r/Alex
> >
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED] [mailto:programming-
> >> [EMAIL PROTECTED] On Behalf Of bill lam
> >> Sent: Thursday, October 18, 2007 11:14 PM
> >> To: Programming forum
> >> Subject: Re: [Jprogramming] unicode string inside arrays
> >>
> >> Alex Rufon wrote:
> >> > Hi Bill,
> >> >
> >> > SHORT ANSWER: No
> >>
> >> If setB does not support widechar unicode, we have to wait until Eric
> >> improve
> >> it.  Alternatively you may serialize the array into xml for
> >> communication, eg
> >>
> >>     ]test=: 2 2$ 42 ; (ucp '对最后问题的答复。') ;  0 ; ucp 'This 
> >> is a
> >> test'
> >> +--+---------------------------+
> >> |42|对最后问题的答复。|
> >> +--+---------------------------+
> >> |0 |This is a test             |
> >> +--+---------------------------+
> >>     j2xml test
> >> <array>
> >>   <rank>
> >>    <dimension>2</dimension>
> >>    <dimension>2</dimension>
> >>   </rank>
> >>   <data>
> >>    <array>
> >>     <data>
> >>      <number>42</number>
> >>     </data>
> >>    </array>
> >>    <array>
> >>     <rank>
> >>      <dimension>9</dimension>
> >>     </rank>
> >>     <data>
> >>      <uchar><![CDATA[
> >> +VsAZw5U7pWYmIR2VHsNWQIw    ]]></uchar>
> >>     </data>
> >>    </array>
> >>    <array>
> >>     <data>
> >>      <number>0</number>
> >>     </data>
> >>    </array>
> >>    <array>
> >>     <rank>
> >>      <dimension>14</dimension>
> >>     </rank>
> >>     <data>
> >>      <char><![CDATA[This is a test]]></char>
> >>     </data>
> >>    </array>
> >>   </data>
> >> </array>
> >>
> >>     xml2j j2xml test
> >> +--+---------------------------+
> >> |42|对最后问题的答复。|
> >> +--+---------------------------+
> >> |0 |This is a test             |
> >> +--+---------------------------+
> >>     test -: xml2j j2xml test
> >> 1
> >>
> >> You have to write j2xml and xml in both in J and c#. BTW I would prefer
> >> using
> >> inverted table to process record set coming from sql sources.
> >>     ifa test
> >> +----+--------------------------------+
> >> |42 0|对最后问题的答复。     |
> >> |    |This is a test                  |
> >> +----+--------------------------------+
> >>     j2xml ifa test
> >> <array>
> >>   <rank>
> >>    <dimension>2</dimension>
> >>   </rank>
> >>   <data>
> >>    <array>
> >>     <rank>
> >>      <dimension>2</dimension>
> >>     </rank>
> >>     <data>
> >>      <number>42 0</number>
> >>     </data>
> >>    </array>
> >>    <array>
> >>     <rank>
> >>      <dimension>2</dimension>
> >>      <dimension>14</dimension>
> >>     </rank>
> >>     <data>
> >>      <uchar><![CDATA[
> >> +VsAZw5U7pWYmIR2VHsNWQIwIAAgACAAIAAgAFQAaABpAHMAIABpAHMAIABhACAAdABlAHM
> >> AdAA=
> >> ]]></uchar>
> >>     </data>
> >>    </array>
> >>   </data>
> >> </array>
> >>
> >>     xml2j j2xml ifa test
> >> +----+--------------------------------+
> >> |42 0|对最后问题的答复。     |
> >> |    |This is a test                  |
> >> +----+--------------------------------+
> >>
> >> PS. in the above examples, CDATA is encoded in base64, but you may
> >> choose other
> >> methods.
> >>
> >> --
> >> regards,
> >> bill


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to