Expand description
Encoding / locale probing utilities.
This module exists mainly for debugging + experiments around R’s string encodings. R’s runtime has both:
- per-CHARSXP encoding tags (UTF-8 / Latin-1 / bytes / native)
- global/locale-level settings (native encoding, UTF-8 locale flags)
§Availability
The global signals are non-API (from Defn.h) and require the nonapi
feature. Only the locale flags R’s shared library exports are read
(utf8locale, mbcslocale, known_to_be_latin1); the hidden ones
(known_to_be_utf8, latin1locale, R_nativeEncoding) must not even be
referenced — an eager data relocation against a hidden symbol aborts
dyn.load of the whole package (see sys::nonapi_encoding).
miniextendr_encoding_init() is not called by package_init; it exists
for debugging and for standalone Rust applications embedding R.
Structs§
- REncoding
Info - Cached snapshot of R’s encoding / locale state at init time.
Statics§
Functions§
- encoding_
info - Return the cached encoding info (if
miniextendr_encoding_init()has run). - miniextendr_
assert_ utf8_ locale - Assert that R’s locale is UTF-8.
- miniextendr_
encoding_ init - Initialize / snapshot R’s encoding state.