aws-samples / aws-samples/lambda-refarch-streamprocessing
Buffer should convert to UTF8 not ASCII
- 主要语言
- JavaScript
- 星标
- 344
- 派生
- 127
- PR 合并指标
- 30 天内没有已合并 PR
描述
I think [line 37](https://github.com/awslabs/lambda-refarch-streamprocessing/blob/master/ddb_eventprocessor.js#L37) 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 😉 .
贡献指南
调研方向
从 ddb_eventprocessor.js 的第 37 行开始,检查 Kinesis payload 在进行 JSON 处理之前是如何解码的。通过检查包含中文或其他非 ASCII 字符的 payload 是否得到保留且不再产生无效 JSON 控制字符错误,确认此更改。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- backend, cloud
- Issue 类型
- 缺陷
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 55/100