Posts: 2
Threads: 1
Joined: Mar 2018
Reputation:
0
05-19-2019, 10:59 AM
(This post was last modified: 05-20-2019, 05:16 AM by MikaK.)
Hi,
I'm migraring on of our vcl apps to intraweb and run to exception "No mapping for the Unicode character exists in the target multi-byte code page".
I understand that it something to with encoding, but how I do encode data when it comes directly from dataset trough datasource?
I'm using Delphi 10.3.1 and IW 15.0.21. At form I have tiwdbedits, tiwdbgrids
Characters are special characters like ä and ö (iso-8859-15)
thanks
mika
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
Unicode supports all possible characters. Individual encodings do not. It sounds like you have a Unicode character that is trying to be encoded in an encoding which has no matching character.
Posts: 2
Threads: 1
Joined: Mar 2018
Reputation:
0
Issue must rise from database component which is still based on BDE. It works on normal vcl apps but probably outputs string as ansistrings still.
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
IW itself uses Unicode and only converts out of Unicode if you specify final HTML output other than Unicode. Even for that, its best to just use Unicode. There really ins't any need to use an older encoding for output now that Unicode is supported everywhere.
Posts: 137
Threads: 32
Joined: Jun 2018
Reputation:
3
Location: USA
So I have the same error on a non BDE (I am using dbexpress) datasource.
If I debug through the iwdbgrids.pas at line 572 I get the error
if CurrentField.DataType in [ftBlob, ftMemo] then begin
LBlobStream := TStringStream.Create('', TEncoding.UTF8); try
(CurrentField as TBlobField).SaveToStream(LBlobStream);
--this is the line the causes the error.
S := LBlobStream.DataString;
finally
LBlobStream.Free;
end;
Any ideas on how to solve this issue? Maybe it is a bad driver.
I am using Seattle and iw14.
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
Is it happening on a specific row of data? What encoding is the data base using for storage?
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
There are so many places this could be an issue with that combination.
I would suggest that you try to narrow it down with a minimal test case in a simple VCL application.