David PHAM-VAN

Fix Windows string encoding

... ... @@ -2,6 +2,10 @@
## 5.6.2
- Fix Windows string encoding
## 5.6.2
- Update Linux and Windows pdfium libraries to 4706
- Remove extra scroll bars on desktop [Jonathan Salmon]
... ...
... ... @@ -6,7 +6,7 @@ description: >
homepage: https://github.com/DavBfr/dart_pdf/tree/master/printing
repository: https://github.com/DavBfr/dart_pdf
issue_tracker: https://github.com/DavBfr/dart_pdf/issues
version: 5.6.2
version: 5.6.3
environment:
sdk: ">=2.12.0 <3.0.0"
... ...
... ... @@ -56,7 +56,7 @@ std::string toUtf8(TCHAR* tstr) {
}
std::wstring fromUtf8(std::string str) {
auto len = MultiByteToWideChar(CP_ACP, 0, str.c_str(),
auto len = MultiByteToWideChar(CP_UTF8, 0, str.c_str(),
static_cast<int>(str.length()), nullptr, 0);
if (len <= 0) {
return false;
... ... @@ -64,7 +64,7 @@ std::wstring fromUtf8(std::string str) {
auto wstr = std::wstring{};
wstr.resize(len);
MultiByteToWideChar(CP_ACP, 0, str.c_str(), static_cast<int>(str.length()),
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), static_cast<int>(str.length()),
&wstr[0], len);
return wstr;
... ...