Unicode to Ascii

J

Jochen Kalmbach [MVP]

Hi Joachim!
How do I convert from unicode to ascii string in C++/CLI?

int main()
{
array<System::Byte> ^ascii =
System::Text::Encoding::ASCII->GetBytes("Hello World");
}

Greetings
Jochen
 
B

Ben Voigt

Jochen Kalmbach said:
Hi Joachim!


int main()
{
array<System::Byte> ^ascii =
System::Text::Encoding::ASCII->GetBytes("Hello World");
}

While I have no doubt that Encoding::ASCII works, it seems awfully
inefficient compared to just calling WideCharToMultibyte.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top