PCRE_UTF16_TO_HOST_BYTE_ORDER(3)
β¨ PCRE_UTF16..._BYTE_ORDER β¨
okay bestie, so this is a page from the PCRE (Perl-compatible regular expressions) manual, section 3. it lives in the 16-bit library and nowhere else, so if you're on the 8-bit side of the house this one is not for you π
πΈ SYNOPSIS πΈ
#include <pcre.h>
int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *output,
PCRE_SPTR16 input, int length, int *host_byte_order,
int keep_boms);
π¦ DESCRIPTION π¦
so this function, which β reminder β exists only in the 16-bit library, no cap, takes a UTF-16 string and converts it into the correct byte order for whatever host you're on right now. and the way it does that is by paying attention to any byte order marks (BOMs) chillin' inside the string π
its arguments are giving very much:
outputβ pointer to the output buffer. and here's the cute part: it may be the same asinputπinputβ pointer to the input bufferlengthβ the number of 16-bit units in the input, or negative for a zero-terminated stringhost_byte_orderβ aNULLvalue, or a non-zero value pointed to, means "start in host byte order"keep_bomsβ if non-zero, the BOMs get copied into the output string π
the result of the function is the number of 16-bit units placed into the output buffer, and that count includes the zero terminator if the string was zero-terminated. so like, do with that number what you will, bestie β¨
and if host_byte_order is not NULL, it gets set to indicate the byte order that is current at the end of the string. little update, for free π
okay and for the full lore: there is a complete description of the PCRE native API in thepcreapipage, and a description of the POSIX API in thepcreposixpage. go read those, fr fr π
π SEE ALSO π
pcreapiβ the complete description of the PCRE native APIpcreposixβ the description of the POSIX API
that's the whole vibe, no notes π«Ά this page is from PCRE 8.30, dated 21 January 2012, and it's a Library Functions Manual moment. mwah. π
π¦ where this page comes from
- alpine 3.22: pcre-doc 8.45-r4 Β· BSD-3-Clause
- alpine 3.23: pcre-doc 8.45-r4 Β· BSD-3-Clause
- alpine 3.24: pcre-doc 8.45-r4 Β· BSD-3-Clause
- arch rolling: pcre 8.45-5 Β· BSD
- centos-stream 9: pcre-devel 8.44-4.el9 Β· BSD
- centos-stream 9: pcre-devel 8.44-4.el9 Β· BSD
- debian bookworm: libpcre3-dev 2:8.39-15
- fedora 43: pcre-devel 8.45-1.fc43.9 Β· BSD-3-Clause
- fedora 43: pcre-devel 8.45-1.fc43.9 Β· BSD-3-Clause
- fedora 44: pcre-devel 8.45-1.fc43.9 Β· BSD-3-Clause
- fedora 44: pcre-devel 8.45-1.fc43.9 Β· BSD-3-Clause
- nixos 26.05: pcre 8.45
- nixos 26.05: pcre-cpp 8.45
- opensuse-leap 16.0: pcre-devel 8.45-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: pcre-devel 8.45-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: pcre-devel 8.45-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: pcre-devel 8.45-160000.2.2 Β· BSD-3-Clause
- ubuntu jammy: libpcre3-dev 2:8.39-13build5
- ubuntu jammy: libpcre3-dev 2:8.39-13ubuntu0.22.04.1
- ubuntu noble: libpcre3-dev 2:8.39-15build1
- ubuntu questing: libpcre3-dev 2:8.39-15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms