Hi Sean. --- In [email protected], "swzoh" <[EMAIL PROTECTED]> wrote: > 0 is sort of a switch to make using "the current system Windows ANSI > code page", which is the one you'll get via GetACP, I think. > Another notice: I also set the second parameter simply to 0, but you > may have to use 1 instead to make 100% sure, which has never been > necessary in my case.
0 works for me as well (as GetACP did, there is also GetOEMCP, BTW). BTW: Do you have any special place where you get these informations (besides googling and MSDN)? > > 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... > 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 > Actually there is a 6-byte overhead in ByteBlock which I simply > ignored here. If it would still crash PP, you may have to use > iwNum*2+6 instead (:iwNum*2+5 may be enough, to be precise). I see. > BTW, I think Alan already implemented a mechanism to appropriately > resize/allocate the needed memory blocks, but it doesn't work somehow > as expected (:I also tried, x1000 for example, however didn't work > either). 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. Mockey 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/
