# HG changeset patch # User Tobias Markmann # Date 1228062887 -3600 # Node ID 4fd60ae97535ca877246daba98b586ea379c099c # Parent 4d3ccc6b581784558fb0ba21c34f3660834ffc1f Converting latin encoded responsed to utf-8 when needed. diff -r 4d3ccc6b5817 -r 4fd60ae97535 util/sasl.lua --- a/util/sasl.lua Sun Nov 30 17:18:31 2008 +0100 +++ b/util/sasl.lua Sun Nov 30 17:34:47 2008 +0100 @@ -132,6 +132,13 @@ if response["realm"] == nil then response["realm"] = "" end + if response["charset"] == nil then + response["username"] = latin1toutf8(response["username"]) + response["realm"] = latin1toutf8(response["realm"]) + elseif response["charset"] ~= "utf-8" then + return "failure", "incorrect-encoding", "The client's response uses "..response["charset"].." for encoding with isn't supported by sasl.lua. Supported encodings are latin or utf-8." + end + local domain = "" local protocol = "" if response["digest-uri"] then