Home Explore Blog CI



neovim

59th chunk of `runtime/doc/luvref.txt`
5775224621d4798d1fabc89735595e95fa070801b9b3fcde0000000100000d3e

uv.metrics_info()                                            *uv.metrics_info()*

                Get the metrics table from current set of event loop metrics.
                It is recommended to retrieve these metrics in a `prepare`
                callback (see |uv.new_prepare()|, |uv.prepare_start()|) in order
                to make sure there are no inconsistencies with the metrics
                counters.

                Returns: `table`

                - `loop_count` : `integer`
                - `events` : `integer`
                - `events_waiting` : `integer`

==============================================================================
STRING MANIPULATION FUNCTIONS                          *luv-string-manipulation*

These string utilities are needed internally for dealing with Windows, and are
exported to allow clients to work uniformly with this data when the libuv API
is not complete.

Notes:
1. New in luv version 1.49.0.
2. See the WTF-8 spec (https://simonsapin.github.io/wtf-8/) for information
   about WTF-8.
3. Luv uses Lua-style strings, which means that all inputs and return values
   (UTF-8 or UTF-16 strings) do not include a NUL terminator.

uv.utf16_length_as_wtf8({utf16})                     *uv.utf16_length_as_wtf8()*

                Get the length (in bytes) of a UTF-16 (or UCS-2) string
                `utf16` value after converting it to WTF-8. The endianness of
                the UTF-16 (or UCS-2) string is assumed to be the same as the
                native endianness of the platform.

                Parameters:
                - `utf16`: `string`

                Returns: `integer`

uv.utf16_to_wtf8({utf16})                                   *uv.utf16_to_wtf8()*

                Convert UTF-16 (or UCS-2) string `utf16` to UTF-8 string. The
                endianness of the UTF-16 (or UCS-2) string is assumed to be
                the same as the native endianness of the platform.

                Parameters:
                - `utf16`: `string`

                Returns: `string`

uv.wtf8_length_as_utf16({wtf16})                     *uv.wtf8_length_as_utf16()*

                Get the length (in UTF-16 code units) of a WTF-8 `wtf8` value
                after converting it to UTF-16 (or UCS-2).

                Note: The number of bytes needed for a UTF-16 (or UCS-2)
                string is `<number of code units> * 2`.

                Parameters:
                - `wtf8`: `string`

                Returns: `integer`

uv.wtf8_to_utf16({wtf16})                                   *uv.wtf8_to_utf16()*

                Convert WTF-8 string in `wtf8` to UTF-16 (or UCS-2) string.
                The endianness of the UTF-16 (or UCS-2) string is assumed to
                be the same as the native endianness of the platform.

                Parameters:
                - `wtf8`: `string`

                Returns: `string`

==============================================================================
CREDITS                                                            *luv-credits*

This document is a reformatted version of the LUV documentation, up-to-date
with commit dcd1a1c (23 Aug 2023) of the luv repository
https://github.com/luvit/luv/commit/dcd1a1cad5b05634a7691402d6ca2f214fb4ae76.

Based on https://github.com/nanotee/luv-vimdocs with kind permission.


vim:tw=78:ts=8:sw=2:et:ft=help:norl:

Title: Libuv: String Manipulation Functions and Credits
Summary
This section details the string manipulation functions in libuv, focusing on conversions between UTF-16 and WTF-8 encodings. It includes functions to determine the length and convert between these formats, assuming native endianness for UTF-16. Also includes credits to the original LUV documentation and the luv-vimdocs project.