PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → HttpRequest + HttpGetResult in iOS return characteres Chinês/Japonês
HttpRequest + HttpGetResult in iOS return characteres Chinês/Japonês
Débuté par adrianoboller, 15 oct. 2014 21:43 - 3 réponses
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 15 octobre 2014 - 21:43
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.
Membre enregistré
3 messages
Popularité : +1 (1 vote)
Posté le 17 octobre 2014 - 10:00
Hi,

Try ANSI or Unicode for you sHTTPResult.
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 17 octobre 2014 - 13:41
:)

Hi Stephane LE BOISSELI,

Project Android init UNICODE Default return Chines/Japones httpGetResult.

I modify to ANSI in Project Description, result HttpGetResult = Ansi Characteres Alfanumeric.

And Analisys ANA String type STRING, no use String Unicode in project, ok

BUT, my project is Android AND iOS Unique Code, Unique Windows.

The alter compiler Android to iOS, the return HttpGetResult = Characteres Chines/Japoneses.

BUT with code up description post init 100% ok

No Problem with Chineses and Japoneses in return the HttpGetResult solution!!!!!! :merci:

OK?

:D
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 24 mars 2016 - 20:46
Prezados,

Caso de problema com acentuação, use:

Esse comando chegou a testar?

retorno is string = UFT8toString(textocomacento)

USE O COMANDO UTF8ToString OU AnsiToUnicode

ProcedureWS_Android_IOS_HTTPGetResult()

// Variable
bufResHTTP is Buffer
sHTTPResult isstring

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

// Result in UTF8 em iOS Apple
IFIniOSMode() =TrueORIniOSSimulatorMode() =TrueORIniOSEmulatorMode() =True
IFStringCount(bufResHTTP, “ISO-8859-1,IgnoreCase) =0THEN
sHTTPResult=UTF8ToString(bufResHTTP)
ELSE
sHTTPResult=AnsiToUnicode(bufResHTTP)
END
ELSE IFInAndroidMode() =TrueORInAndroidSimulatorMode() =TrueORInAndroidEmulatorMode() =True
// Result in Android
sHTTPResult=bufResHTTP
END

RESULTsHTTPResult


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/