aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_sasl.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-10-16 23:00:42 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-10-16 23:00:42 +0500
commitb7e51a203d3d95961294c711ae0d9c449ddb040d (patch)
tree376af083a7225da43a8659f6d0d6184966d10baa /tests/test_sasl.lua
parent85b44a1dfd59fee9a26527cc759ef72780a1668c (diff)
downloadprosody-b7e51a203d3d95961294c711ae0d9c449ddb040d.tar.gz
prosody-b7e51a203d3d95961294c711ae0d9c449ddb040d.zip
Monster whitespace commit (beware the whitespace monster).
Diffstat (limited to 'tests/test_sasl.lua')
-rw-r--r--tests/test_sasl.lua36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/test_sasl.lua b/tests/test_sasl.lua
index 7c0b02f8..8bd1a2ff 100644
--- a/tests/test_sasl.lua
+++ b/tests/test_sasl.lua
@@ -8,30 +8,30 @@
--- WARNING! ---
--- This file contains a mix of encodings below.
+-- This file contains a mix of encodings below.
-- Many editors will unquestioningly convert these for you.
-- Please be careful :( (I recommend Scite)
---------------------------------
-local gmatch = string.gmatch;
-local t_concat, t_insert = table.concat, table.insert;
-local to_byte, to_char = string.byte, string.char;
+local gmatch = string.gmatch;
+local t_concat, t_insert = table.concat, table.insert;
+local to_byte, to_char = string.byte, string.char;
local function _latin1toutf8(str)
- if not str then return str; end
- local p = {};
- for ch in gmatch(str, ".") do
- ch = to_byte(ch);
- if (ch < 0x80) then
- t_insert(p, to_char(ch));
- elseif (ch < 0xC0) then
- t_insert(p, to_char(0xC2, ch));
- else
- t_insert(p, to_char(0xC3, ch - 64));
- end
- end
- return t_concat(p);
- end
+ if not str then return str; end
+ local p = {};
+ for ch in gmatch(str, ".") do
+ ch = to_byte(ch);
+ if (ch < 0x80) then
+ t_insert(p, to_char(ch));
+ elseif (ch < 0xC0) then
+ t_insert(p, to_char(0xC2, ch));
+ else
+ t_insert(p, to_char(0xC3, ch - 64));
+ end
+ end
+ return t_concat(p);
+end
function latin1toutf8()
local function assert_utf8(latin, utf8)