Category Archives: Programming Functions

UnicodeToAnsiString() function

// // C/C++ // #define MAX_LINE_LENGTH 1024 int UniToAnsi(const wchar_t* UniStr, char* AnsiStr){ int u=0, a=0; char* paUniStr = (char*)UniStr; while( true ){ AnsiStr[a] = paUniStr[u]; u+=2; a+=1; if( (paUniStr[u+0]==”) && (paUniStr[u+1]==”) ) break; if(a>=MAX_LINE_LENGTH) break; } AnsiStr[a]=”; return a; … Continue reading

Posted in Programming Functions | Leave a comment