From: san Date: Mon, 16 Feb 2009 06:51:53 +0000 (+0000) Subject: Processing Unicode string returned by Win32 API correctly X-Git-Tag: V2_0_0~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ce6a723ec6d192121a5e99d9876e156830a82f9e;p=modules%2Fgui.git Processing Unicode string returned by Win32 API correctly --- diff --git a/src/SUIT/SUIT_LicenseDlg.cxx b/src/SUIT/SUIT_LicenseDlg.cxx index 4faafba13..359436d9a 100755 --- a/src/SUIT/SUIT_LicenseDlg.cxx +++ b/src/SUIT/SUIT_LicenseDlg.cxx @@ -118,15 +118,16 @@ void SUIT_LicenseDlg::onAgree() { QString env; #ifdef WIN32 - DWORD aLen=1024; - char aStr[1024]; + DWORD aLen=1024; + wchar_t aStr[1024]; HANDLE aToken=0; HANDLE hProcess = GetCurrentProcess(); OpenProcessToken(hProcess,TOKEN_QUERY,&aToken); if( ! GetUserProfileDirectory( aToken, aStr, &aLen ) ) reject(); - env = aStr; + if ( aLen > 0 ) + env = QString::fromWCharArray(aStr, aLen); #else if( ! ::getenv( "HOME" ) ) reject();