From 78c09789f7be66d1844bf8dfd17eb9e7f3851c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Thu, 29 Apr 2021 14:21:37 +0200 Subject: [PATCH] Fix invalid_encoding error when using extended plane characters in vcard. --- rebar.config | 2 +- src/mod_vcard.erl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rebar.config b/rebar.config index 81f3dc84c..1316ffe17 100644 --- a/rebar.config +++ b/rebar.config @@ -56,7 +56,7 @@ {rebar_elixir_plugin, ".*", {git, "https://github.com/processone/rebar_elixir_plugin", "0.1.0"}}}}, {if_var_true, sqlite, {sqlite3, ".*", {git, "https://github.com/processone/erlang-sqlite3", {tag, "1.1.12"}}}}, - {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.25"}}}, + {stringprep, ".*", {git, "https://github.com/processone/stringprep", "6d143ebcacaafe3a8adc669300a8ad001402b3d8"}}, {if_var_true, stun, {stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.43"}}}}, {xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.5.3"}}}, diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 85734b358..e7cfff819 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -424,9 +424,9 @@ set_vcard(User, LServer, VCARD) -> -spec string2lower(binary()) -> binary(). string2lower(String) -> - case stringprep:tolower(String) of + case stringprep:tolower_nofilter(String) of Lower when is_binary(Lower) -> Lower; - error -> str:to_lower(String) + error -> String end. -spec mk_tfield(binary(), binary(), binary()) -> xdata_field().