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

XML Encoding error #234

Open
PG-Ayaney opened this issue Feb 20, 2024 · 0 comments
Open

XML Encoding error #234

PG-Ayaney opened this issue Feb 20, 2024 · 0 comments

Comments

@PG-Ayaney
Copy link

PG-Ayaney commented Feb 20, 2024

When the response from GPT has non UTF8 characters it will raise an error.
Raises in the codeunit GenerateItemSubProposal.Codeunit.al in the procedure GetResult, line 22

TempXmlBuffer.LoadFromStream(InStream);

You can reproduce it by using ES installation on Items with accents.

To solve this issue please modify the GenerateItemSubProposal.Codeunit.al lines 37 to 39 with this (GenerateItemProposal procedure):

    OutStream := TempBlob.CreateOutStream(TextEncoding::UTF8);
    OutStream.WriteText(TmpText);
    TempBlob.CreateInStream(InStream, TextEncoding::UTF8);

With that modification you can parse properly the XML and preserve the accents:
image

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

1 participant