mconv_encode_stream(3m17n)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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_IO
  • MERROR_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 (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