0

I'm creating a Windows Credentials Provider using the Microsoft's "Sample All UI" example.

As French speaker, i need to use accents like that : "éàèê". All my strings are widechar strings (syntax: L"Numéro de téléphone"), and all the strings functions i use are the widechar version (wcsdup, wcscpy...)

But when i load my provider, accents spawn as a set of random chars like © or Ã. It clearly looks like an encoding error, but I cant find how.

Are Credentials providers supporting special chars ? I known that default credential provider in french will display accents.

Thank you very much.

Tom
  • 47
  • 7
  • 1
    Not a help but may be a hint: As German speaker, I see often `Ã` as first of two characters for `äöüß` when something is written (encoded) in UTF-8, but displayed (decoded) with these ancient Windows-ANSI-1252 character stuff. – Scheff's Cat Sep 28 '20 at 09:02
  • Windows is UTF-16 through and through. Looking at `ICredentialProviderUser::GetStringValue` and the like, I see just `LPWSTR`. – MSalters Sep 28 '20 at 09:24
  • I know that it is LPWSTR, that why i cannot understand why i get this issue. – Tom Sep 28 '20 at 13:59
  • Maybe the issue is non inside of code but inside of compiled DLL? Try to compile your resources using 1200 code page. – Alexander Sep 30 '20 at 06:36

1 Answers1

0

I finally loaded my text as UTF-8 from a file, and conveted it to UTF-16 with this function :

MultiByteToWideChar(CP_UTF8, 0, s.c_str(), slength, 0, 0);

Note the flag : CP_UTF8

I used theses generated strings, and it worked.

Tom
  • 47
  • 7