-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bug: sam local invoke still print the response in latin-1 #5229
Comments
@guanlinz Thanks for the report. I started a PR to hopefully address this. The issue you linked was about the event to the "local" Lambda not being encoded not the output. What do you mean by "This issue only hapeens in STDOUT with sam local invoke, I can get correct and human readable Chineses character via API Gateway"? I need to validate in Lambda but it's possible we are matching Lambda behavior and Does this work in |
Just tested on the AWS Lambda console. The PR I submitted now matches the same response. So likely we just were not encoding things correctly locally for some time. |
yes, it works. Here are the detail: Start the local api:
Request:
Response:
|
Patch is released in v1.95.0. Closing |
Description:
Passing the event in Chineses to sam local invoke produces results like unsupported character.
This issue only hapeens in STDOUT with
sam local invoke
, I can get correct and human readable Chineses character via API GatewayI go through the closed issue and got this: #2494, seems like the issue is fixed in 2021, but in my testing result, it didn't.
Steps to reproduce:
SAM Template:
Event.json:
Lambda code:
Invoking method:
sam local invoke -e events/event.json
Observed result:
STDOUT with
sam local invoke -e events/event.json
:Expected result:
It should print the meanful Chineses character in STDOUT, like in below
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.84.0The text was updated successfully, but these errors were encountered: