native-transcoder(3scm)
π native-transcoder(3scm) β the Scheme Programmer's Manual, but make it cute
okay so bestie, we're in the native-transcoder(3scm) page of the Scheme Programmer's Manual and honestly? this one's short and sweet. let's get into it π«Ά
β¨ NAME β¨
native-transcoder β the transcoder for the native transcoding. that's it, that's the whole name, no notes π
π LIBRARY π
two ways to get at it, pick your fighter:
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
π SYNOPSIS π
(native-transcoder)
zero arguments, zero drama, one call. iconic behaviour honestly β
π DESCRIPTION π
So what does it actually do? It returns an implementation-dependent transcoder that represents a possibly locale-dependent "native" transcoding. like, it's giving "whatever your OS thinks is normal" energy and we respect it π
The tea β: this is commonly a UTF-8 transcoder with eol-style none on Unix-like systems, and crlf on DOS and Windows systems β but ngl it can be anything that goes well with the native operating system. so don't come for it if it's not exactly that, the implementation gets to choose, fr fr π
π§ IMPLEMENTATION NOTES π§
See the notes in native-eol-style(3scm). that's where the eol lore lives, go read it bestie π
π¦ RETURN VALUES π¦
Returns a single value β a transcoder. just the one, no bonus surprises, no cap β¨
πΈ EXAMPLES πΈ
here's the little demo and it ate, lowkey:
(transcoder-error-handling-mode (native-transcoder))
=> replace
see? replace. default error handling mode said "we move" π
π APPLICATION USAGE π
You don't just stare at the returned transcoder (as tempting as that is) β you pass it as an argument to various I/O procedures, like:
bytevector->string(3scm)string->bytevector(3scm)open-bytevector-output-port(3scm)open-file-input-port(3scm)open-file-output-port(3scm)
that's its whole job and it's doing it beautifully π«Ά
π COMPATIBILITY π
Transcoders are unique to the R6RS I/O system. so if you're on some other Scheme situation, this is not gonna vibe-check for you, sorry bestie π
π₯ ERRORS π₯
This procedure can raise exceptions with the following condition types:
&assertion(R6RS) β the wrong number of arguments was passed. you gave it an argument, it wanted none (or vice versa) and now we're all looking at each other π
π SEE ALSO π
native-eol-style(3scm)β the sibling page, the eol icon itself, go show it some love π
β STANDARDS β
R6RS. that's the standard, periodt π
π HISTORY π
This procedure was introduced in R6RS as part of the reworked I/O system. so it's a glow-up baby, born in the great I/O rework β¨
π§ AUTHORS π§
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://github.com/schemedoc/manpages/. shoutout to the maintainers, they're the real main characters tbh π«Ά
and that's the whole page bestie, no skip, no summary, every single detail intact, we ate and left no crumbs π
source / version: native-transcoder(3scm) Β· date: 2022-05-14 β mwah, signed off with love, go transcode something iconic π
π
π¦ where this page comes from
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2022 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms