SimUtil Strings ansiToUnicode 1

From SIMboxWiki
Jump to navigation Jump to search



Icon attributes.pngstatic std::wstring SimUtil::Strings::ansiToUnicode(const std::string &i_StrAnsi)

    Description

    Converts string given in ANSI standard to a string in Unicode standard.

    Parameters

    i_StrAnsi - A string containing ANSI characters that will be converted to Unicode.

    Return

    Type: std::wstring   Description: A Unicode string containing the converted string.

    Code Sample
    

          int main(int argc, char* argv[])
{
	//create ANSI characters string
	string ansiString = "Hello, World!";

	//convert ANSI characters string to Unicode characters string
	wstring unicodeString = SimUtil::Strings::ansiToUnicode(ansiString);

	//print result
	cout<<"The string is:"<<endl;
	cout<<unicodeString.c_str()<<endl;
  
	return 0;
}

Output:
-------
The string is:
Hello, World!


    See Also

     unicodeToAnsi