RKCVTZEN(3)

πŸ’– RKCVTZEN(3) πŸ’–

okay bestie, so this one is RkCvtZen, a lil function from the Library Functions Manual, and it's literally here to glow up your ASCII and your single-width katakana into full-on double-width characters. the way that it just does that?? iconic. ✨


🌸 NAME 🌸

RkCvtZen β€” convert ASCII characters and single-width katakana to double-width characters

like. that's the whole job. no cap. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <canna/RK.h>
int RkCvtZen(dst, maxdst, src, srclen)
unsigned char *dst;
int maxdst;
unsigned char *src;
int srclen;

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie πŸ“ β€” RkCvtZen takes the srclen bytes of ASCII character and single-width katakana data and converts them to double-width character, starting at the area src. she's giving makeover energy, fr fr.

a couple things you need to know before you go in:

  • a null character in src is not interpreted as the end of the string. like, she does not stop at null. she keeps going. periodt.
  • the conversion result gets stored in the area dst. πŸ“₯
  • characters that are not subject to conversion are copied as they are β€” no edits, no notes, just vibes. ✨
  • the conversion result is truncated to adjust to character boundaries in the EUC code when its byte length exceeds maxdst -1. so if you under-budget your destination, she's trimming to keep things clean at the boundaries.
  • dst is padded with null characters at the end if possible. 🫢
  • EUC code is used to represent both src and dst. iykyk.
and then the plot twist πŸ’€ β€” NULL can be specified in dst. and when you do that, NULL overrides the entire conversion result. literally nothing gets written out. the whole thing. gone. so don't do that unless that's what you meant, bestie.

πŸ‘‘ RETURN VALUE πŸ‘‘

this function returns the byte length of the conversion result. πŸ“

or β€” and hear me out β€” it returns 0 if the value of maxdst is invalid. so if you get a zero back, that's the vibe check failing, not a successful empty conversion. πŸ™ˆ


🌈 SEE ALSO 🌈

not gonna lie, this page doesn't list any SEE ALSO references, so we're just gonna sit here and be cute together. πŸ’œ


and that's the whole page, babe! this one came out of the Library Functions Manual as RKCVTZEN(3) β€” mwah, mwah, take care of her, and remember: valid maxdst, non-NULL dst, and she'll slay every single time. πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from