Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
UTF8 vs ANSI
Hey,
Our Openinsight is not UTF8
With php we receive UTF8 JSON from a mobile app.
Finally we were able to send the request in UTF8 to the framework.
Now we find that with the call "SRP_HashTable_Set(MemoryServicesManagers@, KeyID, Value)"
the post-string is put in the hashtable, but if we read the value back immediately, the string is a few characters shorter. (because of utf8 chars?)
Converting the POST-string to ANSI in php corrupts the json.
What are we doing wrong or what is the best way to process UTF8 data in an ansi Openinsight.
Regards Ed
Our Openinsight is not UTF8
With php we receive UTF8 JSON from a mobile app.
Finally we were able to send the request in UTF8 to the framework.
Now we find that with the call "SRP_HashTable_Set(MemoryServicesManagers@, KeyID, Value)"
the post-string is put in the hashtable, but if we read the value back immediately, the string is a few characters shorter. (because of utf8 chars?)
Converting the POST-string to ANSI in php corrupts the json.
What are we doing wrong or what is the best way to process UTF8 data in an ansi Openinsight.
Regards Ed
Comments
What do you mean with "turning on UTF8 on dynamically"?
We run the engine now with "UTFPortNumber"
The idea is that we can use utf_ansi after we pulled the values from json.
What I meant by "turning UTF8 on dynamically" was using the SetUTF8() routine.
Work-around seems to be to force ANSI mode around the SET method. Eg
string = 'kééman\n“Dubbele quote”\n‘Enkele quote’' handle = SRP_Hashtable( 'CREATE') utf8mode = isUTF8() Setutf8( 0) ;// Force single-byte mode SRP_Hashtable( 'SET', handle, 'opmerking', string) Setutf8( utf8mode) ;// restore previous UTF8 mode setting value = SRP_Hashtable( 'GET', handle, 'opmerking') SRP_Hashtable( 'RELEASE', handle)
Cheers, M@