Election-Tech-Initiative / electionguard-cpp

A C++ implementation of ElectionGuard specification focused on encryption components.
https://www.electionguard.vote/
MIT License
23 stars 26 forks source link

handle internationalized strings on windows #176

Open AddressXception opened 3 years ago

AddressXception commented 3 years ago

Bug Report

Expected Behavior international character sets are handled in utf-16

Actual Behavior when marshalling strings from c# to the native library, the character set is misinterpreted. likely due ot the use of wide string and converting to string.

steps to reproduce:

netframework ManifestGenerator uncomment one of the lines that includes spanish language. set a break in the Manifest.h c++/cli wrapper constructor after Utilities::MarshalString(json, _json);

expected: the string is properly translated actual: the string has extra characters

Environment

AddressXception commented 3 years ago

the dllimport calls probably need the charset explicitly set