wmi_string_from_utf8s(9)
β¨ wmi_string_from_utf8s(9) β¨
okay bestie, welcome to the Kernel API Manual β today's main character is wmi_string_from_utf8s, and honestly? she's giving "glow-up translator" energy π
π NAME π
wmi_string_from_utf8s β literally converts a UTF8 string into a WMI string. no cap, that's the whole gig π¦
πΈ SYNOPSIS πΈ
ssize_t wmi_string_from_utf8s (struct wmi_string *str , size_t max_chars
, const u8 *src , size_t src_length );
like, look at her signature. so clean. so iconic. β¨
π ARGUMENTS π
strβ the WMI string representation, aka where the magic lands π«Άmax_charsβ the maximum number of UTF16 code points you're allowed to store inside the WMI string. that's her limit, respect it π§srcβ the UTF8 string you're converting (the source, the muse, the blueprint) π¦src_lengthβ length of the source string, and listen: without any trailing NUL-characters. so don't be counting those, bestie π
π DESCRIPTION π
so here's the vibe check π: this function converts a UTF8 string into a WMI string.
the conversion stops when the WMI string is full β no overflow drama, she just knows when to stop π
and when this function returns successfully? the resulting WMI string will always be NUL-terminated, and its length field will be set to an appropriate value. always. periodt. π
π₯ RETURN π₯
she hands you back the number of UTF16 code points inside the WMI string π
or, if things go sideways, a negative errno code. π that's the fail state, and yes, it's negative, look out for it.
π§ SEE ALSO π§
- Kernel file
./drivers/platform/wmi/string.c wmi_string_to_utf8s(9)β the reverse queen, go say hi π
okay but seriously bestie, if max_chars is small the string gets cut off β that's not a bug, that's just her stopping when she's full π
mwah, that's the whole page π this lil' slice of kernel docs lives in ./drivers/platform/wmi, dated October 2026 β and it's wmi_string_from_utf8s(9) all the way down, iykyk βπΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms