Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EEncodingError #490

Closed
atiweb opened this issue Mar 16, 2021 · 1 comment
Closed

EEncodingError #490

atiweb opened this issue Mar 16, 2021 · 1 comment
Assignees
Labels
accepted Issue has been accepted and inserted in a future milestone need more info open Some team member is working on this
Milestone

Comments

@atiweb
Copy link

atiweb commented Mar 16, 2021

{
"classname": "EEncodingError",
"detailedmessage": "",
"apperrorcode": 0,
"items": [

],
"statuscode": 500,
"reasonstring": "error",
"message": "No mapping for the Unicode character exists in the target multi-byte code page",
"data": null
}

Using ** DMVCFramework Server ** build 3.2.2 (nitrogen)
Delphi 10.4 Update1

The error arraise when trying to read string fields containing portuguese characters Ç

To reproduce just try to process that kind of data using TMVCActiveRecord

The error raise in MVCFramework.Serializer.Commons.pas
line 1132: lSStream := TStringStream.Create('', TEncoding.Unicode);
That line was changed to lSStream := TStringStream.Create('', TEncoding.ASCII);

Update:
In line 1132 remove entirely the encoding:
lSStream := TStringStream.Create('');

That assign the TMBCSEncoding class as the default encoding. More in:
http://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.TMBCSEncoding
It appear to be a better solution

and the error disappear and now all working normally, but I dont know if that will have some other impact more ahead in others areas of the Framework.
Also if the problem is proved to be a bug, please pull fix in source files.

Similar errors also referenced here:
https://www.facebook.com/groups/delphimvcframework/permalink/1895046327245164/
#36
#315

But situations diferent in it owns ways

The real problem is not of DMVCFramwork, but of Embarcadero itself, as can be read here:
https://stackoverflow.com/questions/35708827/what-could-cause-no-mapping-for-the-unicode-character-exists-in-the-target-mult
The proposed solution is just a workaraound, but not the optimal one

Thanks.

@danieleteti danieleteti added this to the 3.2.3-radium milestone Nov 24, 2022
@danieleteti danieleteti self-assigned this Nov 24, 2022
@danieleteti danieleteti added accepted Issue has been accepted and inserted in a future milestone open Some team member is working on this need more info labels Nov 24, 2022
@danieleteti
Copy link
Owner

I did the change. All the Unit Test are OK, but it's a border case. Can you provide a specific test which would arire the problem so that I can add the test in the unittest project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Issue has been accepted and inserted in a future milestone need more info open Some team member is working on this
Projects
None yet
Development

No branches or pull requests

2 participants