[PATCH] vbscript: Implemented String(try 2)
Shuai Meng
mengshuaicalendr at gmail.com
Sun Nov 2 09:57:08 CST 2014
Thanks very much for commenting, I'm trying to fix this.
2014-10-29 23:14 GMT+08:00 Akihiro Sagawa <sagawa.aki at gmail.com>:
> On Wed, 29 Oct 2014 17:57:15 +0800, Shuai Meng wrote:
> > I have tested this for many times, but it is very strange that the
> result
> > of String(1, 564) varies with different platforms, running in cmd on xp,
> > it equals to String(1, 564 / 256) while equals to String(1, 564 mod 256)
> > running directly in vbs script(meaning save vbs code as test.vbs and
> double
> > click it).
> > That confuses me a lot, according to MSDN documents, it should equal to
> > String(1, 564 mod 256), I don't know how to handle it.
>
> Hello Shuai,
>
> Despite MSDN documents, VBScript String function accepts double-byte
> character code in DBCS locale based on my tests. That means you can
> specify like String(3, &HE0E0) where &HE0E0 is an ANSI codepage
> character code not a Unicode codepoint.
> I guess String(1, 564) is internally interpreted as "\x02\x34" in DBCS
> locale. As you know, \x02 isn't a valid lead-byte character, so, you got
> "\x02". On the other hand, in SBCS locale, VBScript engine did 564 mod
> 256, thus, Piotr got "4".
>
> Regards,
> Akihiro Sagawa
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141102/13b2ccea/attachment.html>
More information about the wine-devel
mailing list