--- In [email protected], "Sheri" <sheri...@...> wrote: > > --- In [email protected], "entropyreduction" > <alancampbelllists+yahoo@> wrote: > > > > I could easy add config ini keys checkForUnicodeArgs, > > checkForUnicodeResult. All or nothing, either checking happens or > > it doesn't (obviously if I can;t locate unicode plugin, checking > > never happens). > I suppose ini could house defaults, although personally I think default > should always be ANSI.
You mean default should be "never check for unicode handles" and "never attempt to translate result strings with chars > 255 into a stored unicode string"? > But in scripts we could do something like: > > e.g., com.returnUnicodestrings(1) and com.returnUnicodestrings(0) Two separate issues, maybe handles with three levels: com.handleUnicode(0) ;; do nada ; check for unicode stringn handles in args, but never produce ; a unicode handle com.handleUnicode(1) ; check for unicode stringn handles in args, produce ; unicode handles if output strign contains chars > 255 com.handleUnicode(2) or could be done with two separate services com.returnUnicodeHandles com.checkForUnicodeHandles > and similar for enabling/disabling checking for unicode args. I no longer > think you should "check" for unicode results char>255. If the script wants to > treat the returned string as unicode, it should be possible to do so > (regardless if only low value characters are used). ???? Don't follow. When I convert a BSTR (aka WCHAR*) to ANSI with WideCharToMultiByte, any WCHAR that won't fit in a CHAR (8 bits, max 0xFF) is lost. If you want to keep such high values, gotta use a unicode string, and return a handle. > Also I don't think com should automatically load the unicode plugin. If the > user wants to load the unicode plugin, it is easily done, e.g., with > unicode.version. If com.returnUnicodestrings(1) and unicode is not already > loaded, generate an error. (I seem to remember Bruce added something that > makes it possible to test if a plugin is loaded). If unicode is not loaded, > and checking for unicode arguments is enabled, arguments cannot really be in > unicode; just send the strings. Will continue to load unicode plugin, unless user has indicated no interest by calls to com.returnUnicodeHandles(0) and com.checkForUnicodeHandles(0), or equivalent config ini keys.
