Search 500 errors on unicode
example crash with "猫"
Request: GET /api/v2/search?q=%E7%8C%AB&resolve=true&limit=10
** (exit) an exception was raised:
** (Postgrex.Error) ERROR 22021 (character_not_in_repertoire) invalid byte sequence for encoding "UTF8": 0xe7 0x3a 0x2a
(ecto_sql) lib/ecto/adapters/sql.ex:618: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql) lib/ecto/adapters/sql.ex:551: Ecto.Adapters.SQL.execute/5
(ecto) lib/ecto/repo/queryable.ex:153: Ecto.Repo.Queryable.execute/4
(ecto) lib/ecto/repo/queryable.ex:18: Ecto.Repo.Queryable.all/3
(ecto_sql) lib/ecto/adapters/sql.ex:887: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
(db_connection) lib/db_connection.ex:1415: DBConnection.run_transaction/4
(pleroma) lib/pleroma/user/search.ex:27: Pleroma.User.Search.search/2
(pleroma) lib/pleroma/web/mastodon_api/search_controller.ex:20: Pleroma.Web.MastodonAPI.SearchController.search2/2
Reference for the codepoint: https://www.compart.com/en/unicode/U+732B
it appears URL decoding of GET args is broken
i'm running master
Edited by piggo