FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
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
Connectez-vous…
adrianoboller
#1
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 15 octobre 2014 - 21:43
Hi Guys,
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!
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
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.
Signaler
1
0
Stephane LE BOISSELI
#2
Membre enregistré
3 messages
Popularité : +1 (1 vote)
Posté le 17 octobre 2014 - 10:00
Hi,
Try ANSI or Unicode for you sHTTPResult.
Signaler
1
0
adrianoboller
#3
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!!!!!!
OK?
Signaler
0
0
adrianoboller
#4
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
buf
ResHTTP is Buffer
s
HTTPResult isstring
// Retrieves the result of the query
buf
ResHTTP
=
HTTPGetResult
(
httpResult
)
// Result in UTF8 em iOS Apple
IFIniOSMode
(
) =
TrueORIniOSSimulatorMode
(
) =
TrueORIniOSEmulatorMode
(
) =
True
IFStringCount
(
buf
ResHTTP
, “
ISO
-
8859
-
1
”
,
IgnoreCase
) =
0
THEN
s
HTTPResult
=
UTF8ToString
(
buf
ResHTTP
)
ELSE
s
HTTPResult
=
AnsiToUnicode
(
buf
ResHTTP
)
END
ELSE
IFInAndroidMode
(
) =
TrueORInAndroidSimulatorMode
(
) =
TrueORInAndroidEmulatorMode
(
) =
True
// Result in Android
s
HTTPResult
=
buf
ResHTTP
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/
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
WEBDEV (précédentes versions)
WINDEV Mobile (précédentes versions)
Etats & Requêtes
Hors-sujet
Outils
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte