Software /
code /
verse
Annotate
libs/encodings.lua @ 480:a48a4723aa2a
Add time query plugin
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 17 Mar 2023 12:30:49 +0000 |
parent | 432:07a0f9f2e69d |
child | 489:39ed19f12dca |
rev | line source |
---|---|
107
59c6f2deb8ab
libs/encodings.lua: Throw error when calling unimplemented function
Matthew Wild <mwild1@gmail.com>
parents:
0
diff
changeset
|
1 local function not_impl() |
130
5de7f66e4168
libs/encodings.lua: Use mime.b64 for base64.encode
Matthew Wild <mwild1@gmail.com>
parents:
107
diff
changeset
|
2 error("Function not implemented"); |
107
59c6f2deb8ab
libs/encodings.lua: Throw error when calling unimplemented function
Matthew Wild <mwild1@gmail.com>
parents:
0
diff
changeset
|
3 end |
59c6f2deb8ab
libs/encodings.lua: Throw error when calling unimplemented function
Matthew Wild <mwild1@gmail.com>
parents:
0
diff
changeset
|
4 |
130
5de7f66e4168
libs/encodings.lua: Use mime.b64 for base64.encode
Matthew Wild <mwild1@gmail.com>
parents:
107
diff
changeset
|
5 local mime = require "mime"; |
5de7f66e4168
libs/encodings.lua: Use mime.b64 for base64.encode
Matthew Wild <mwild1@gmail.com>
parents:
107
diff
changeset
|
6 |
0 | 7 module "encodings" |
8 | |
431
9d7a293849f3
libs.encodings: Export empty idna table
Matthew Wild <mwild1@gmail.com>
parents:
391
diff
changeset
|
9 idna = {}; |
0 | 10 stringprep = {}; |
391
b496f0262a3f
libs.encodings: mime.unb64 is buggy with \0 should have been fixed
Kim Alvefur <zash@zash.se>
parents:
130
diff
changeset
|
11 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
|
12 utf8 = { |
07a0f9f2e69d
libs.encodings: Add encodings.utf8 compat (works on Lua 5.3+)
Matthew Wild <mwild1@gmail.com>
parents:
431
diff
changeset
|
13 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
|
14 }; |
0 | 15 |
16 return _M; |