English > Support
Dynamic SQL error when the title is Chinese
itforay:
Hi! The same problem with bellow post.
http://www.videodb.info/forum_en/index.php?topic=950.0
Some of Chinese title are ok, but others are not.
For example: 锅盖头
PS: If i use New Movie, it can work correctly. But if i use New Movie Master the problem will be show.
nostra:
Could you please provide me with a number of real examples of Chinese titles?
itforay:
for example:
just one character 恶
3 characters 锅盖头 中国字 打广告
5 characters 魔力女战士
i test several title, it is so strange!
even count characters is ok, but odd count characters will raise SQL Error.
I Google some similar problems, it actually exists.You program with C++?
http://www.qqgb.com/Program/VC/VCJQ/Program_176134.html
This is a short explain. it is coding problem, CString to Unicode.
if the title is even count characters, so the bytes are even count, then it can be transformed to Wchar correctly.
but for odd count, the bytes are odd count, so it can not be transformed to Wchar correctly.
I hope this can help solve the problem.
WCHAR uData[] = L"I服了you!";
char * buffer;
int nLength = 0;
nLength = WideCharToMultiByte(CP_ACP,NULL,uData,-1,NULL,0,NULL,NULL);
buffer = (char*)malloc(nLength);
WideCharToMultiByte(CP_ACP,NULL,uData,-1,buffer,nLength,NULL,NULL);
MessageBox(buffer);
free(buffer);
nostra:
Thanks for the info. I am programming with Delphi, but the problem could be similar to the one in C++. I will check this right away.
itforay:
BTW. This problem just raise when I use New Movie Master.
I can modify the title to Chinese, the program will accept, no error raised.
Thank you. ;)
Navigation
[0] Message Index
[#] Next page
Go to full version