WiX: Extracting Binary-string in Custom Action yields string like "???good data" -


i found weird behavior when attempting extract string binary table in msi.

i have file containing hello world, data ???hello world. (literary question mark.)

is intended?
3 characters in beginning?


sample code:

[customaction] public static actionresult customaction2(session session) {     view v = session.database.openview("select `name`,`data` `binary`");     v.execute();      record r = v.fetch();     int datalen = r.getdatasize("data");     system.io.stream strm = r.getstream("data");     byte[] rawdata = new byte[datalen];     int res = strm.read(rawdata, 0, datalen);     strm.close();      string s = system.text.encoding.ascii.getstring(rawdata);     // s == "???hello world"      return actionresult.success; } 

wild guess, if created file using notepad, couldn't byte order mark?


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -