RTC Forums
November 24, 2024, 07:46:08 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Sending string from server to client  (Read 4560 times)
YuraZ
Newbie
*
Posts: 39


« on: December 03, 2012, 11:05:52 AM »

Hi,

I'm using RTC SDK 6.
From TRtcFunction.OnExecute program is returning ciphered string, as Result.AsString := '...'. In debug window Result.AsString is showing as:
#6')ђN'#$12'АeІ;—'#$B'Ќ'#$00AD'(Р’'#7'Eц$©вХуh'#$1A'Jѓ“•F”'

But when I'm trying to receive this string on client on TRtcResult.OnReturn as Result.asString in debug windows is showing as:
#6')?N'#$12'?e?;'#$0097#$B'?'#$00AD'(?'#$0092#7'E?$©???h'#$1A'J?'#$0093#$0095'F'#$0094

Why strings are different?
What should i do to make this strings the same?

Thanks.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: December 03, 2012, 01:23:30 PM »

Where does the original String come from? I mean the one you are assigning to Result.asString on the Server in the OnExecute event? It looks like that String contains 16-bit characters (ђ - for example).

The "asString" property will only send the lower 8 bits of each character (#0 - #255). If you want to send Unicode Strings, you should use "asText" instead of "asString". And if you want to send binary data (encrypted), you should use "asByteStream" or "asByteArray".

Is the function you are using for generating the "cipher" returning a String, or is it returning something else and you have converted it into a String?

Best Regards,
Danijel Tkalcec
Logged
YuraZ
Newbie
*
Posts: 39


« Reply #2 on: December 03, 2012, 05:40:10 PM »

Thanks a lot!!!

Using asText solved my problem.  Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 17 queries.