diff options
Diffstat (limited to 'doc/lua-filters.md')
| -rw-r--r-- | doc/lua-filters.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 2a9787f4f..ca9fbd43e 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -2418,6 +2418,18 @@ function Str (s) end ``` +### fromencoding {#text.fromencoding} + +`fromencoding(s, encoding)` + +Converts a string to UTF-8. The `encoding` parameter specifies the +encoding of the input string. On Windows, that parameter defaults +to the current ANSI code page; on other platforms the function +will try to use the file system's encoding. + +See [`toencoding`](#text.toencoding) for more info on supported +encodings. + ### lower {#text.lower} `lower (s)` @@ -2449,6 +2461,19 @@ Returns the length of a UTF-8 string. Returns a substring of a UTF-8 string, using Lua's string indexing rules. +### toencoding {#text.toencoding} + +`toencoding(s, encoding)` + +Converts a UTF-8 string to a different encoding. The `encoding` +parameter defaults to the current ANSI code page on Windows; on +other platforms it will try to guess the file system's encoding. + +The set of known encodings is system dependent, but includes at +least `UTF-8`, `UTF-16BE`, `UTF-16LE`, `UTF-32BE`, and `UTF-32LE`. +Note that the default code page on Windows is available through +`CP0`. + # Module pandoc Fields and functions for pandoc scripts; includes constructors for |
