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

Request.Body encoding bug #36

Closed
feelple opened this issue Mar 23, 2016 · 5 comments
Closed

Request.Body encoding bug #36

feelple opened this issue Mar 23, 2016 · 5 comments

Comments

@feelple
Copy link

feelple commented Mar 23, 2016

example data, charset utf-8
[{"barcode":"8801062318490","company_code":"민","quantity":5,"date":"2016-03-23","kind":"1"}]

"민" is korean.

error message
[EEncodingError] No mapping for the Unicode character exists in the target multi-byte code page

> original code
function TMVCWebRequest.Body: string;
....
  try
    Result := InEnc.GetString(TEncoding.ANSI.GetBytes(FWebRequest.RawContent));
  finally
    InEnc.Free;
  end
....

> my code
function TMVCWebRequest.Body: string;
....
  try
    SetLength(Buffer, FWebRequest.ContentLength);
    FWebRequest.ReadClient(Buffer[0], FWebRequest.ContentLength);

    Result := InEnc.GetString(Buffer);
  finally
    InEnc.Free;
  end
@danieleteti
Copy link
Owner

Did you pulled the latest version?
Which Delphi Version are you using?

@feelple
Copy link
Author

feelple commented Mar 23, 2016

yes, lastest version.
i am using delphi 10 seattle.

@danieleteti
Copy link
Owner

Please, send me a minimal project which replicates the problem.

@feelple
Copy link
Author

feelple commented Mar 23, 2016

DMVCFramework.zip

example project

@danieleteti
Copy link
Owner

Your changes have been merged. Thank you for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants