38
27

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

redis-cliでマルチバイト文字列が文字化けする時はrawオプションを使う

Posted at

redisでマルチバイト文字列が文字化けして困る時は

$ redis-cli
redis 127.0.0.1:6379> set hoge "まるくす"
OK
redis 127.0.0.1:6379> get hoge
"\xe3\x81\xbe\xe3\x82\x8b\xe3\x81\x8f\xe3\x81\x99"

こんな風にrawオプションを付けたら解決します

$ redis-cli --raw
redis 127.0.0.1:6379> set hoge "まるちゃん"
OK
redis 127.0.0.1:6379> get hoge
まるちゃん

参考文献

38
27
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
38
27

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?