FcUtf16ToUcs4(3)

πŸ’– FcUtf16ToUcs4(3) β€” the fontconfig girlies know πŸ’–

okay so bestie, we're in the FcUtf16ToUcs4 corner of the fontconfig manual (FcUtf16ToUcs4(3), section 3, iykyk) and honestly? it's a little baddie of a function. let's get into it ✨


🌸 NAME 🌸

FcUtf16ToUcs4 β€” convert UTF-16 to UCS4. that's it, that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <fontconfig/fontconfig.h>

int FcUtf16ToUcs4 (FcChar8 *src, FcEndian endian, FcChar32 *dst, int len);

like, iconic signature. no notes. πŸ’…


✨ DESCRIPTION ✨

so here's the tea β˜• β€” FcUtf16ToUcs4 converts the next Unicode char from src into dst, and returns the number of bytes containing the char. that return value is literally your receipt of how much src got eaten πŸ§ΎπŸ’–

src must be at least len bytes long β€” no cap, that's non-negotiable, so pls don't hand it a buffer that's too short πŸ™ˆ

and the bytes of src? they get combined into 16-bit units according to endian. so endian is the main character here, deciding how those bytes get stitched together πŸͺ‘✨

fr fr: len is the length you're promising src has, and endian controls the byte pairing. get those right and you're slaying.

πŸŽ€ sign-off πŸŽ€

this lil masterpiece is from Fontconfig 2.17.0, dated 27 June 2025 β€” a whole era. go forth and convert those chars, bestie πŸ’œπŸ«Ά

πŸ“¦ where this page comes from