--- In [email protected], "entropyreduction" 
<alancampbelllists+ya...@...> wrote:
>
> --- In [email protected], "silvermoonwoman2001" <sherip99@> wrote:
> >
> > > > > ; musical G clef      == 0xD834 0xDD1E
> > > > > local uStr =  unicode.from_nums(0x1D11E)
> > > > > unicode.set_base(0)
> > > > > ;gives expected results
> > > > > win.debug(win.hex(uStr[0]), win.hex(uStr[1]))
> > > > 
> > > > What is are win.hex(uStr[0]), win.hex(uStr[1] supposed to show? win.hex 
> > > > of actual unicode..? It is debugging 0 0
> > > 
> > > Should show 0xD834 0xDD1E with latest temp version of unicode plugin..
> > 
> > OK, not zero any more, but:
> > not 0xD834, actually d834
> > not 0xDD1E, actually dd1e
> 
> Yeah, that's the way win.hex shows a hex number.
> 
> The point is unicode.from_nums is converting a unicode code point 
> beyond BMP to the correct surrogate pair.
>  
> > But you forgot to change the arguments in your sample to send the code 
> > point in hex instead of in decimal to ReturnUTF8.
> > 
> > this would work:
> > win.debug(ReturnUTF8("1D11E").tonumx)
> > 
> > and this:
> > win.debug(ReturnUTF8("1D11").tonumx)
> 
> So do utf8 results match? ReturnUTF8 vs plugin conversion.  Can;t test, don't 
> have that script on this machine.
>

Yes, identical.

local codepoint="1D11E"
;; musical G clef       == 0xD834 0xDD1E
local uStr =  unicode.from_nums(convertbase(codepoint,16,10))
win.debug("["++(uStr.to_utf8).tonumx++"]==[" ;;+
++ReturnUTF8(codepoint).tonumx++"]")

Regards,
Sheri

Reply via email to