From: Tom Hughes Date: Thu, 16 May 2024 16:48:48 +0000 (+0100) Subject: Treat the body as UTF-8 for user_preferences#update X-Git-Tag: live~903^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/64af2816a3f788c360434a73a234d41ef4c9f66e Treat the body as UTF-8 for user_preferences#update --- diff --git a/app/controllers/api/user_preferences_controller.rb b/app/controllers/api/user_preferences_controller.rb index 02a23095a..99d224c51 100644 --- a/app/controllers/api/user_preferences_controller.rb +++ b/app/controllers/api/user_preferences_controller.rb @@ -66,7 +66,7 @@ module Api pref.k = params[:preference_key] end - pref.v = request.raw_post.chomp + pref.v = request.raw_post.chomp.force_encoding("UTF-8") pref.save! render :plain => ""