mconv_encode_stream(3m17n)
π mconv_encode_stream β the m17n Library, bestie edition π
okay so real talk, this one lives in the m17n Library manual, section 3m17n, and it's called mconv_encode_stream. she's a little function with one job and she does it beautifully. let's get into it π
β¨ SYNOPSIS β¨
int mconv_encode_stream (MSymbol name, MText * mt, FILE * fp)
πΈ DESCRIPTION πΈ
so basically β encode an M-text and write it straight to a stream. that's the whole vibe π
mconv_encode_stream() takes your M-text mt, encodes it based on the coding system name, and writes the resulting byte sequence out to the stream fp.
and here's the cute part: a temporary code converter for the encoding gets created automatically, and then it gets freed. you don't have to do a single thing about it. it's giving self-sufficient queen πβ¨
π¦ RETURN VALUE π¦
if everything went off without a hitch, mconv_encode_stream() returns the number of written bytes. slay π
otherwise? she returns -1, and assigns an error code to the external variable merror_code. π not the error code jump scare.
π ERRORS π
these are the possible error codes, no cap:
MERROR_IOMERROR_CODING
π SEE ALSO π
if you're obsessed with this one (and why wouldn't you be), go check out her friends:
mconv_encode()mconv_encode_buffer()mconv_encode_file()
iykyk π«Ά
π COPYRIGHT π
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.
and that's the whole page, bestie π this was Version 1.8.4, dated Mon Sep 25 2023, from the mconv_encode_stream(3m17n) page β periodt ππ§
π¦ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms