-----BEGIN PGP SIGNED MESSAGE----- Moin,
On Saturday 06 March 2004 15:29, Nick Ing-Simmons wrote: > Tels <[EMAIL PROTECTED]> writes: > >-----BEGIN PGP SIGNED MESSAGE----- > >I call it from Perl with: > > > > $app->setWindowCaption("Some String"); > > > >Thi does (surprise!) not work properly, because "Some String" is one > > byte per char, while I assume that wchar is two bytes. > > Why do you assume that? Because I have no idea about wchar. > - Windows has wchar_t as 16-bit and is UCS-2 or perhaps UTF-16 Ugh. > - Many modern UNIXes have wchar_t 32-bit and use UCS-4 I am on linux, but the same source (that uses wchar) is also compiled under Windows. Since it apparently works on both, I need to emulate both. From C++ constant strings are passed in as L"SomeString". How do I emulate that froma Perl e.g. convert a Perl scalar to this? > What system are you on? > Which locale / codepage are you in? > > >How do I convert the perl > >string so that it can be passed to the C++ function? > > > >Is there something which would do this for me easily? L"String" as seen > > in C ++ does not work in Perl, would some sort of Encode help? > > If you encode("YourCodePage,"SomeString") then SvPV of the thing should > be suitably encoded can can be cast to a wchar_t * Ok, which CodePage do I then use? Yes, sorry, I don't know nothing about codepages, unicode etc. Cheers, Tels - -- Signed on Sat Mar 6 15:59:48 2004 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "Naturally the parameter and boundary of their respective position and magnitude are naturally determinable up to the limits of possible measurement as stated by the general quantum hypothesis and Heisenberg's uncertainty principle, but this indeterminacy in precise value is not a consequence of quantum uncertainty. What this illustrates is that in relation to indeterminacy in precise physical magnitude, the micro and macroscopic are inextricably linked, both being a part of the same parcel, rather than just a case of the former underlying and contributing to the latter." -- Peter Lynd -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. iQEVAwUBQEnn8XcLPEOTuEwVAQFCUAf9EKxlyQsqp+5oo0DPRaojdriMjKe+Llk3 USIP4f3VGZqaScOE0+88OHsGJqZGQ5pqcnxYqEAJiyngfj0q+2JcomuJ5V1Q3yk6 7xX93RJxZmH+ituR8NtpZQDEe0fJzHsdK5Ojyrs9DTvTNSPQw1CqtG5+woUWE5DS f4WXOWBg1O7YqmZzfo+73ZrhabsPODjivR0PHM47RGRNAqIE/i3qMrpc1BrzkoHd YlHpR7R2OwKn7dSPAVZqLCFhNw05QkosaMf+mD4OqYWggE7Kp+WQXkr6/1CwAcYT Nl4AsrLnePyjn0DliyTdFYKaUW5yI+8IpJu5eBgLVFMOs3eOaP2v3Q== =aLEG -----END PGP SIGNATURE-----