--- In [email protected], "Sheri" <sheri...@...> wrote:
 
> No I meant the default-default would be "never check for unicode handles" and 
> "never return unicode handles" 

Agreed, otherwise existing stuff breaks.
 

> > ???? 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. 
> 
> Normally a substitute character is used during conversion, e.g., a question 
> mark.

Yeah.  Incidentaly I can make that character is 
controllable in services like unicode.toascii, or whatever I called it.  E.g. 
by adding another argument e.g.  han.toascii(bad_char_substitute)
 
> The way you have proposed to do it (strings are returned as ANSI except when 
> the content has high value characters), any script that enables unicode 
> return-strings would need to test the content of each returned string to see 
> if it looks like "u\x53nnn". If the script wants to handle unicode, why not 
> let it declare that's what it wants and let it handle even low value 
> characters as unicode? Otherwise the same function called in a loop sometimes 
> returns a unicode handle and sometimes not!

Okay, so service would be maybe

  com.always_return_strings_as_unicode_handles_please_i_beg_you(0/1)


> > > 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.
> >
> 
> I think zeros should be the defaults, because as noted above I think if the 
> script is handling certain return strings as unicode, it will want all those 
> strings to be unicode.

Sure, agreed.
 
> There could even be existing working scripts that stop running, because it 
> used to get a normal string (maybe with a question mark in it) but after 
> update starts getting "u/x53nnn" instead.

The HORROR!!!



Reply via email to