From: SourceForge.net <no...@so...> - 2004-11-19 14:08:04
|
Bugs item #1068029, was opened at 2004-11-17 15:09 Message generated for change (Comment added) made by shiphrah You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373085&aid=1068029&group_id=22049 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Juergen Hofmann (shiphrah) Assigned to: Amir Szekely (kichik) Summary: possible bug in ResourceVersionInfo.cpp Initial Comment: ResourceVersionInfo.cpp, Revision: 1.11 void CResourceVersionInfo::ExportToStream(... possibly contains a bug with the following two statements: KeyName = StrToWstrAlloc(pChildStrings->getname(i), codepage); KeyValue = StrToWstrAlloc(pChildStrings->getvalue(i), codepage); The problem is, that e.g. with the usag of the Unicode codepage, thus codepage = 1200, the call to StrToWstrAlloc fails. I guess that using CP_ACP instead should fix the problem, but I am not sure about all consequences. ---------------------------------------------------------------------- >Comment By: Juergen Hofmann (shiphrah) Date: 2004-11-19 15:08 Message: Logged In: YES user_id=1160914 The additional parameter would definitely solve the problem. However, I believe that it is not necessary, because you say that the function expects ANSI strings. If this is really the case, I guess: KeyName = StrToWstrAlloc(pChildStrings->getname(i), CP_ACP); KeyValue = StrToWstrAlloc(pChildStrings->getvalue(i), CP_ACP); should do the trick (i.e. always convert from ANSI and set the codepage in the resource as specified). (But perhaps I really get it completely wrong...) ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2004-11-19 13:34 Message: Logged In: YES user_id=584402 The method always converts because it expects ANSI strings, not Unicode. It does the conversion using the codepage you pass it. I guess what you want is another parameter to set the codepage specified in the resource. Is that correct? ---------------------------------------------------------------------- Comment By: Juergen Hofmann (shiphrah) Date: 2004-11-19 08:57 Message: Logged In: YES user_id=1160914 Sorry, I guess I was not clear enough. I don't want to convert Unicode to Unicode, but e.g. ANSI to Unicode. If a NSIS script results into a call to (although I think this is not possible from within a script right now) CResourceVersionInfo::SetKeyValue( 1033, 1200, "aKeyName", "aValue"); That is, you want to have the resource use the Unicode codepage (that's what we do with our products), you will get an invalid resource, because the call described in my last comment fails. I don't think it causes problems in the current version of NSIS as far as scripts are concerned, but I believe it's a bug and may cause problems for extensions, etc. ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2004-11-18 20:01 Message: Logged In: YES user_id=584402 Why would you want to convert Unicode to Unicode? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373085&aid=1068029&group_id=22049 |