Software /
code /
verse
Annotate
libs/encodings.lua @ 501:419c248919e8
util.dataforms: Remove local copy
The main difference was the from_stanza() function, which was used in
by 'clix adhoc', so moving it there seems sensible. Maybe reconsider
upstreaming it to Prosody, but it's not used anywhere there.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 23 Jun 2023 12:38:58 +0200 |
parent | 489:39ed19f12dca |
rev | line source |
---|---|
130
5de7f66e4168
libs/encodings.lua: Use mime.b64 for base64.encode
Matthew Wild <mwild1@gmail.com>
parents:
107
diff
changeset
|
1 local mime = require "mime"; |
5de7f66e4168
libs/encodings.lua: Use mime.b64 for base64.encode
Matthew Wild <mwild1@gmail.com>
parents:
107
diff
changeset
|
2 |
0 | 3 module "encodings" |
4 | |
431
9d7a293849f3
libs.encodings: Export empty idna table
Matthew Wild <mwild1@gmail.com>
parents:
391
diff
changeset
|
5 idna = {}; |
0 | 6 stringprep = {}; |
391
b496f0262a3f
libs.encodings: mime.unb64 is buggy with \0 should have been fixed
Kim Alvefur <zash@zash.se>
parents:
130
diff
changeset
|
7 base64 = { encode = mime.b64, decode = mime.unb64 }; |
432
07a0f9f2e69d
libs.encodings: Add encodings.utf8 compat (works on Lua 5.3+)
Matthew Wild <mwild1@gmail.com>
parents:
431
diff
changeset
|
8 utf8 = { |
07a0f9f2e69d
libs.encodings: Add encodings.utf8 compat (works on Lua 5.3+)
Matthew Wild <mwild1@gmail.com>
parents:
431
diff
changeset
|
9 valid = (utf8 and utf8.len) and function (s) return not not utf8.len(s); end or function () return true; end; |
07a0f9f2e69d
libs.encodings: Add encodings.utf8 compat (works on Lua 5.3+)
Matthew Wild <mwild1@gmail.com>
parents:
431
diff
changeset
|
10 }; |
0 | 11 |
12 return _M; |