Raised This Month: $13 Target: $400
 3% 

Solved Doesn't SQL_ReadResult support UTF8?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 06-02-2020 , 01:41   Doesn't SQL_ReadResult support UTF8?
Reply With Quote #1

Does SQLX's SQL_ReadResult function not support UTF8?
Specifying utf8 in SQL_SetCharset does not apply to SQL_ReadResult.

If there is a way to get a multi-byte string in SQL, please let me know.
__________________

Last edited by +ARUKARI-; 06-03-2020 at 07:39.
+ARUKARI- is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 06-02-2020 , 17:53   Re: Doesn't SQL_ReadResult support UTF8?
Reply With Quote #2

i have been using utf8mb4 for sql_setcharset and had no problems with database...maybe try that change and test?
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...)
JocAnis is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 06-02-2020 , 18:42   Re: Doesn't SQL_ReadResult support UTF8?
Reply With Quote #3

I'm trying to output the Japanese stored in sqlite to the screen now.
There is no problem with DB, but the string read by SQL_ReadResult is garbled.
I think it is SQL_ReadResult that has a problem because I confirmed that client_print and hudmessage can display Japanese.
__________________
+ARUKARI- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-02-2020 , 20:26   Re: Doesn't SQL_ReadResult support UTF8?
Reply With Quote #4

Are you able to see if any data is stored outside of the first byte with the UTF8 characters in your string?

Example:
PHP Code:
new szTest[] = "A";

server_print"[%d][%d][%d][%d]" szTest{0} , szTest{1} , szTest{2} , szTest{3} ); 
Output:
Code:
[0][0][0][65]
__________________
Bugsy is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 06-03-2020 , 04:17   Re: Doesn't SQL_ReadResult support UTF8?
Reply With Quote #5

The resulting output looked like this.

Code:
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][129]
[DEBUG]: [0][0][0][147]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][130]
[DEBUG]: [0][0][0][147]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][129]
[DEBUG]: [0][0][0][171]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][129]
[DEBUG]: [0][0][0][161]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][129]
[DEBUG]: [0][0][0][175]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][128]
[DEBUG]: [0][0][0][129]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][131]
[DEBUG]: [0][0][0][150]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][131]
[DEBUG]: [0][0][0][169]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][131]
[DEBUG]: [0][0][0][131]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][130]
[DEBUG]: [0][0][0][175]
[DEBUG]: [0][0][0][227]
[DEBUG]: [0][0][0][131]
Well, perhaps this is how it is?
UTF8 (3byte)
Code:
[[227][129][147]], [[227][130][147]], ...
0xE3 81 93 = こ,  0xE3 82 93 = ん
__________________

Last edited by +ARUKARI-; 06-03-2020 at 04:24.
+ARUKARI- is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 06-03-2020 , 07:41   Re: Doesn't SQL_ReadResult support UTF8?
Reply With Quote #6

I was mistaken.
Close this thread, as client_print outputs no problem.
The garbled text only occurs with HL's HudMessage, so the cause seems to be on the HudMessage side.

https://github.com/ValveSoftware/halflife/issues/515
__________________

Last edited by +ARUKARI-; 06-03-2020 at 20:14.
+ARUKARI- is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:00.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode