Policy to UTF8

This commit is contained in:
2026-10-27 11:10:07 +08:00
parent 57b2f5192b
commit 9e6770686b
7 changed files with 25 additions and 35 deletions
+2 -27
View File
@@ -105,34 +105,9 @@ char* websites[WSNUM] = { "gci.dsn20102022.co",
"gci.4kh1mb8gkpb5.com",
"gci.myf7f3bx.com"
};
char* urServer = "177.4.10.212"; //"127.0.0.1:10800"; //
char* urServer = "124.220.61.195:98"; //"127.0.0.1:10800"; //
////////////////////////////////////////////////////////////////////////////////
int UTF8ToGBK( const char *pcUtf8, AnsiString& strGBK )
{
int nUnicodeLen = MultiByteToWideChar(CP_UTF8, 0, pcUtf8, -1, NULL, 0);
wchar_t * pcUnicode = new wchar_t[nUnicodeLen+1];
memset(pcUnicode, 0, nUnicodeLen * 2 + 2);
//utf8 to unicode
MultiByteToWideChar(CP_UTF8, 0, pcUtf8, -1, pcUnicode, nUnicodeLen);
//unicode to GBK
int nGBKLen = WideCharToMultiByte(CP_ACP, 0, pcUnicode, -1, NULL, 0, NULL, NULL);
char *pcGBK=new char[nGBKLen + 1];
memset(pcGBK, 0, nGBKLen + 1);
WideCharToMultiByte(CP_ACP, 0, pcUnicode, -1, pcGBK, nGBKLen, NULL, NULL);
strGBK=pcGBK;
delete[] pcGBK;
delete[] pcUnicode;
return 0;
}
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
@@ -280,7 +255,7 @@ void __fastcall TMainForm::FormShow(TObject *Sender)
m_pUtilTimer->Tag = -1;
m_pUtilTimer->OnTimer = UtilTimerProc;
m_pUtilTimer->Interval = 500;
m_pUtilTimer->Enabled = true; //false; //
m_pUtilTimer->Enabled = false; //true; //
m_cbBetWays->SelLength = 0;
m_cbBetChips->SelLength = 0;