PX_SET_TARGETENCODING(3)

πŸ’– PX_SET_TARGETENCODING(3) πŸ’–

okay bestie, welcome to the PX_set_targetencoding page from the Library Functions Manual β€” yes it's a manual page, yes it's from the library functions section, and yes we're gonna make it cute. sit down, grab a boba πŸ§‹, let's go.


✨ NAME ✨

PX_set_targetencoding β€” set the encoding for output, bestie πŸŽ€


✨ SYNOPSIS ✨

#include <paradox.h>

int PX_set_targetencoding(pxdoc_t *pxdoc, const char *encoding)

✨ DESCRIPTION ✨

So what does this actually do, you ask? 🌸 It sets the target encoding for all alpha fields. Like, every single one. No cap.

It gets used when data is retrieved from a record β€” that's its whole moment, its main character energy πŸ‘‘.

The encoding has to be a name, exactly as it's described by the man and info pages of recode or iconv β€” whichever one is being used, iykyk. A super common value on Unix systems is latin1. πŸ’…

And here's the tea, so listen up: if you don't set the encoding, then PX_get_data_alpha(3) will return field data in the original encoding. But if you do set it, it will recode the field data instead. That's the whole difference, periodt. ✨

Also, heads up 🫢 β€” this function is literally just a short cut form of PX_set_parameter(pxdoc, "targetencoding", encoding), and it is deprecated. Not me warning you about deprecated functions 😭 but here we are.

✨ RETURN VALUE ✨

  • Returns -2 if recoding is not supported 😭
  • Returns a value < 0 in case of an error πŸ’€
  • Otherwise returns 0 β€” slay, we love a clean success ✨

✨ SEE ALSO ✨

go read these too, they're all connected bestie 🌈


✨ AUTHOR ✨

This manual page was written by Uwe Steinmann uwe@steinmann.cx. πŸ’œ giving credit where credit is due, as we always do.


and that's the whole page, babe πŸ¦‹ this was PX_SET_TARGETENCODING(3) from the Library Functions Manual β€” no date on it, just vibes and a version tag, mwah πŸ’…πŸ’–