PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
[WM23 and WD21] SocketWrite from iOS and SocketRead from Service Windows
[WM23 and WD21] SocketWrite from iOS and SocketRead from Service Windows
Started by ARV, Feb., 22 2019 8:15 PM - 1 reply
Connect yourself…
ARV
#1
Registered member
498 messages
Popularité : +8 (8 votes)
Posted on February, 22 2019 - 8:15 PM
Hi all
I have this issue with the following set up
I have windev mobile 23
and Windev 21
on Windev Mobile 23 I have a project on iOS
there I use SocketConnect to connect to my server where I have the service on Windev 21
the message I send it's like this
num is int
messageA,MessageB is string
Message is buffer
Message = num+messageA+MessageB
I use this to put it on SocketWrite on iOS
Then on Windev 21 service project when I process this message it only gets me the first letter of the buffer
Message:
123,A,A
Message Service:
1
this occure because some conflicts on Ansi and Unicode it's like the message it's on Unicode and I want to show Ansi
but then again I changed the project string to Unicode
just to be sure I delcared a variable on Unicode string and nothing seems to work.
the way I read the socket it's with a buffer then I asing on a string what I read on the buffer.
any ideas?
--
Best Regards
ARV
Report
0
0
ARV
#2
Registered member
498 messages
Popularité : +8 (8 votes)
Posted on February, 23 2019 - 4:01 PM
Hi all
I finally understand what is happening
Android and PC have the same UNICODE but iOS (iPhone) doesn't
so all I need to do it's just to transform to UTF8 with StringToUTF8
all of my strings of iOS, Android and PC
send it iOS and Android on UTF8 to PC
Then on PC transform UTF8ToString to handle the info then send it like StringToUTF8 to Android and iOS
Then do the exact same thing like PC transform UTF8ToString and that's it I can read all the info.
The same thing it's with CryptStandard and UncryptStandard with iOS and Android or PC
you need to transform every string to UTF8 to use CryptStandard
do not do StringToUTF8(CryptSTandard) because it's wrong keep it on buffer the result of CryptSTandard just the buffers of the function transform in into UTF8
then on UncryptStandard you need to use it like this:
//Remember the buffer needs to be on UTF8
UTF8ToString
(
UncryptStandard
(
buf
Message
,
buf
Pass
,
"I USE DEFAULT BUT SEARCH SOMETHING THAT COULD BE GLOBAL FOR PLATAFORMS"
)
//CryptStandard
buf
Message
is
buffer
=
StringToUTF8
(
"MESSAGE"
)
buf
Pass
is
buffer
=
HashString
(
"USE A GLOBAL FUNCTION HERE FOR WHAT YOU NEED"
,
StringToUTF8
(
"PASSWORD"
)
buf
Crypt
is
buffer
=
CryptStandard
(
buf
Message
,
buf
Pass
,
"I USE DEFAULT BUT SEARCH SOMETHING THAT COULD BE GLOBARL FOR YOUR PLATAFORMS"
)
then you will see the message normaly
buf if you send messages from socket on iOS to PC or Android then all you need to do its on the part of the string convert it to UTF8
then on the other side transform UTF8ToString and everything works great!.
Good Luck my fellows developers.
--
Best Regards
ARV
Message modified, February, 23 2019 - 4:07 PM
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text