PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile (précédentes versions) → Solution Httprequest + HttpGetResult return Character Chines in iOS or Android
Solution Httprequest + HttpGetResult return Character Chines in iOS or Android
Débuté par adrianoboller, 15 oct. 2014 21:47 - Aucune réponse
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 15 octobre 2014 - 21:47
Hi Guys, :D

I was going through would be a problem with my ANDROID and iOS (Apple iphone/ipad) mixed design, on a single project.

In Android at all ok to use the webservice query and submit data using HttpRequest + HttpGetResult same as in examples

BUT he sent in iOS (Apple ipad/iPhone) right and came back in Chinese/Japones!!!!!!!! ;(

After three days of several attempts managed to find a solution! :merci:

Httprequest = use the same there as in the examples of PCSoft to make the request to webservices and websites.

BUT HttpGetResult = Developed a global procedure to treat this problem :o

PROCEDURE Android_IOS_HTTPGetResult()
// Variable
bufResHTTP is Buffer
sHTTPResult is string

// Retrieves the result of the query
bufResHTTP = HTTPGetResult(httpResult)

// Result in UTF8 em iOS Apple
IF IniOSMode() = True OR IniOSSimulatorMode() = True OR IniOSEmulatorMode() = True
IF StringCount(bufResHTTP, “ISO-8859-1”, IgnoreCase) = 0 THEN
sHTTPResult = UTF8ToString(bufResHTTP)
ELSE
sHTTPResult = AnsiToUnicode(bufResHTTP)
END
ELSE IF InAndroidMode() = True OR InAndroidSimulatorMode() = True OR InAndroidEmulatorMode() = True
// Result in Android
sHTTPResult = bufResHTTP
END

RESULT sHTTPResult

100% ok in Android and iOS on a single project.

Return ANSI Code Legivel