1

Topic: Delphi XE+Android+TStringStream. DataString

Application at handling of a line takes off: s: = ss. DataString
Here the code:

var
tt:TMemoryStream;
ss:tstringstream;
s:string;
...
begin
...
tt. LoadFromFile ('/sdcard/DCIM/Camera ' + ' /IMG_20161107_155217.jpg ');
tt. SaveToStream (ss);
s: = ss. DataString;
...

Error:
No mapping for Unicode cgaracter exists in multy-byte code page
Prompt how to solve?

2

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

Prompt how to solve?

What difficulties forced you to transform a picture to lives at line?

3

Re: Delphi XE+Android+TStringStream. DataString

_Vasilisk _;
It is necessary to transfer a file from the client to the server...

4

Re: Delphi XE+Android+TStringStream. DataString

I do all through DataSnape

5

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

I Do all through DataSnape

If he is not able to transfer the binary data (that ) then pack contained in Base64

6

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y;
1) in Delphi Xe there is no support of Androida - you hide something
2) s should be RawByteString, instead of string = UnicodeString
3) and it is even more reliable - transfer the data through base64 in the line
4) or use TBlobStream

7

Re: Delphi XE+Android+TStringStream. DataString

Arioch;
1. Delphi XE7
2. The people help with  for in  a cat  examples on a file transfer from the client to the server and those under  are not ground which as I come nearer to "dream" I, and with your help can be there faster smile about base64 and TBlobStream
: a trial and error method too  I will include and I will "be engaged" for example with TBlobStream, but suddenly you throw off an example faster. Than I "" a method will write the code...

8

Re: Delphi XE+Android+TStringStream. DataString

By the way, here at once received: [dcc32 Fatal Error] ServerMethodsUnit1.pas... (unit scope "BDE" indicates Win32 only)

9

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

(unit scope "BDE" indicates Win32 only)

What BDE under Android? He and on Windows hardly lives. Throw out  and dig

10

Re: Delphi XE+Android+TStringStream. DataString

_Vasilisk _;
I by council tried to pass it on TBlobStream as the total received the given error...

11

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

_Vasilisk _;
It is necessary to transfer a file from the client to the server...

Base64 not ? Whom we transfer?

12

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

tt. LoadFromFile ('/sdcard/DCIM/Camera ' + ' /IMG_20161107_155217.jpg ');
tt. SaveToStream (ss);
s: = ss. DataString;
...

Prompt how to solve?

Here it is direct at line?
And BLOB than it is not pleasant?

13

Re: Delphi XE+Android+TStringStream. DataString

Makar4ik wrote:

it is passed...
Here it is direct at line?
And BLOB than it is not pleasant?

BlobStream
I already wrote result above: Bde unit. DBTables only under Take out

14

Re: Delphi XE+Android+TStringStream. DataString

Makar4ik;
File from the client-androida on the server-Windows.
The given application (client) perfectly works under , but by operation under  () the specified error takes off.
Apropos base64 give though ON VODKA as with it to work in my case

15

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

2. The people help with .... I about base64

And what, Google already cancelled?
* http://stackoverflow.com/questions/2188 … ec-library
* http://stackoverflow.com/questions/1710 … de-base-64
* http://www.webdelphi.ru/2014/09/para-sl … ogo-v-rtl/

16

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

as with it to work in my case

Yes as the e-mail works
To send  the binary data in the base64-text (to taste - at first ZIP-uesh, and then base64)
On the server, turned out text (AnsiString) you send.
On the client - the base64-text you transform reversely in binary given (to taste - time-ZIP-ovyvaesh).
base64 Increases length of the data approximately by 30 %
Pictures archivers practically do not press close, so in your case zip is not necessary

17

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

BlobStream
I already wrote result above: Bde unit. DBTables only under Take out

The programmer should be curious, follow an example cats and search for slots in which it is possible to climb through
Simply example - we go in http://docwiki.embarcadero.com/Librarie … TBlobField
Also we look links in See Also
Also we see there not only BDE-BlobStream, but also MIDAS-BlobStream, DBX-BlobStream, ADO-BlobStream....

18

Re: Delphi XE+Android+TStringStream. DataString

And still we go here: http://docwiki.embarcadero.com/Librarie … veToStream
And chi-that!
Also we learn about LoadFromStream and about CreateBlobStream
Variants - a heap, only take and use

19

Re: Delphi XE+Android+TStringStream. DataString

And even Data. DB.TBlobField. LoadFromFile

20

Re: Delphi XE+Android+TStringStream. DataString

Dmitry Y wrote:

Makar4ik;
File from the client-androida on the server-Windows.
The given application (client) perfectly works under , but by operation under  () the specified error takes off.
Apropos base64 give though ON VODKA as with it to work in my case

yes simple recoding of a binary flow in a text type. On vodka - Google like not  questioning...

21

Re: Delphi XE+Android+TStringStream. DataString

Arioch wrote:

it is passed...
Yes as the e-mail works
To send  the binary data in the base64-text (to taste - at first ZIP-uesh, and then base64)
On the server, turned out text (AnsiString) you send.
On the client - the base64-text you transform reversely in binary given (to taste - time-ZIP-ovyvaesh).
base64 Increases length of the data approximately by 30 %
Pictures archivers practically do not press close, so in your case zip is not necessary

Not, I do not advise jpeg to turn gzip th.
Only will be worse.