LoginSignup
6
1

More than 3 years have passed since last update.

Slack bot でコマンド実行するときに、スマート引用符にハマった話

Posted at

社内で、Slack bot で AWS Lambdaを起動する仕組みがあり
「このコマンドで行けるよ」と教えられ、コマンドをコピペしてSlackに投稿したところ
以下のエラーが出た

@aws lambda invoke --payload {"foo": "bar"} --function-name awesome-function --region ap-northeast-1
but unfortunately the service returned an exception:
Could not parse request body into json: Unexpected character ('“' (code 8220 / 0x201c)): was expecting double-quote to start field name

しばらく意味がわからず悩んでいたのだが、code 8220 / 0x201c のあたりをみて
引用符が勝手に変換されてるのでは?と気づいた。
(Microsoft Wordとかでデフォルトで使ってるとなる、引用符を自動的に変換するやつ)

調べてみると予想通り、Slackにコマンドをペーストしたタイミングで、
Macの「スマート引用符」の機能がはたらいて
ASCIIのダブルクウォートではない文字に置き換わってしまっていたのが原因。

キーボードの設定から「スマート引用符とスマートダッシュを使用」をOffにしたら解決した。

mac-keyboard-setting.png

6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1