--- In [email protected], "mockey_a" <[EMAIL PROTECTED]> wrote:
> 
> 0 works for me as well (as GetACP did, there is also GetOEMCP, BTW).

You may use 1 for OEMCP, and 2 for MACCP.
In my case, ACP and OEMCP are the same, 949, and MACCP is 10003.

> BTW: Do you have any special place where you get these informations 
> (besides googling and MSDN)?

No. I even didn't know the webpages you linked.

> > > x is for a byteblock, right?
> > Actually this is needed to get the size of the will-be-returned
> > unicode string, so "xString" doesn't play a role here.
> 
> Yes, I got that. I was just wondering what to use as LPWSTR. Thought 
> it had to be something special...

ByteBlock's main purpose is to be used as LPWSTR or alike which can
have embedded nulls, I suppose.

> > I think you mean the surrogate pair in UTF-16, right? I suppose it
> > would be counted as 2 wide characters, not simply as 1 wide 
> character,
> > so *2 would be enough. However, I'm not 100% sure about this.
> 
> If you look at 
> http://www.unicode.org/charts/
> you see that most scripts are covered by using two bytes (up to 
> 0xFFFF) but there are some that go beyond. I don't know what 
> happens, if there is a character like U-10400. Should take 3 bytes 
> then as a wide char. But rather unlikely, I know.
> Definitely you easily get 3 bytes for UTF8-chars

I think you mean code-points (range of 0 ~ 10FFFF currently). 10400 is
outside the so-called BMP (range of 0 ~ FFFF), so it's represented by
4 bytes in UTF-16, even so in UTF-8. The code-points in BMP are
represented by 2 bytes in UTF-16, whereas 1/2/3 bytes in UTF-8.

> I tried this as well. It was not very clear to me. In the end I used 
> byteblock without any parameter, but I didn't try longer strings 
> with that. Default length always seems to be 263 (output of 
> binary.length). You get length of 1000 if you use x1000. Will play 
> around with longer strings.
> Great work by Alan, anyway. Thanks.

The current default size of PP's variable is 272 bytes, including
terminating null. Then increased by 16 bytes when needed. You can
experiment it using undocumented function Win.DumpVar("var_name"). So,
maybe in ByteBlock case:
263 = 272 - 6 - 4 + 1
where 6 is the byteblock's overhead, and 4 may be terminating null in
 unicode string case and among them 1 may be counted again as the
(plain) terminating null character.

It's purely my guess, BTW.

Sean





Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to