Skip to content

Buffer should convert to UTF8 not ASCII #2

@cameck

Description

@cameck

I think line 37 should be rewritten as payload = new Buffer(record.kinesis.data, 'base64').toString('utf8');

I recently ran into a situation where I could not for the life of me figure out why I kept getting this mysterious unexpected token error in Lambda's Cloudwatch console. After a few hours of testing and debugging, I finally figured out that I was passing invalid JSON Control Characters. BUT, what was really happening was I was converting chinese characters to ASCII.
The standard should be UTF8 to support our global connectivity 😉 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions