1

I am developing a device driver in Visual C++. I need to convert a character array to Unicode as well as wide character array in my driver.

Pointer to useful functions will be appreciated. I know "RtlInitUnicodeString" which concerts wchar to Unicode but need help for conversion of simple character arrays.

whatisinaname
  • 333
  • 4
  • 15
  • What is the encoding of your "character array"? Which Unicode encoding do you want in output? – Matteo Italia Apr 20 '11 at 15:37
  • If it is a char array then the encoding could already be Unicode (UTF-8). PS the term Unicode is not an encoding it is a general description of character codepoints. It can be encoded in a couple of different ways (UTF-8/16/32) – Martin York Apr 20 '11 at 17:40

1 Answers1

1

If you are ok with the "current system locale" setting for the input encoding and the output in the usual UTF-16, the RtlAnsiStringToUnicodeString should be available in kernel-mode.

Matteo Italia
  • 123,740
  • 17
  • 206
  • 299
  • First converted the character array to ANSI_STRING using "RtlInitAnsiString()" and then used RtlAnsiStringToUnicodeString(). – whatisinaname Apr 20 '11 at 17:30