RKCVTHAN(3)
π RKCVTHAN β okay bestie, let's talk character conversion π
So this is a page from the Library Functions Manual, and it's all about RkCvtHan and RkwCvtHan. Two icons, one job. Let's get into it. β¨
πΈ NAME πΈ
RkCvtHan, RkwCvtHan β these cuties convert double-width symbols, alphanumeric characters, hiragana, and katakana into single-width characters. That's the whole vibe. π
π SYNOPSIS π
#include <canna/RK.h>
int RkCvtHan(dst, maxdst, src, srclen)
unsigned char *dst;
int maxdst;
unsigned char *src;
int srclen;
int RkwCvtHan(dst, maxdst, src, srclen)
wchar_t *dst;
int maxdst;
wchar_t *src;
int srclen;
Like, look at them. So tidy. π«Ά
π¦ DESCRIPTION π¦
Okay so RkCvtHan takes the srclen bytes of your double-width symbol, alphanumeric, hiragana, and katakana data and converts them to single-width characters, starting from the area at src. Lowkey a glow-up for your text. π
Heads up bestie: a null character in src is not treated as the end of the string. She does not stop for nulls. Periodt.
The conversion result goes into the area dst. Characters that aren't subject to conversion get copied over exactly as they are β no notes, no changes, we respect them. π
When the byte length of the result would exceed maxdst -1, the conversion result gets truncated so it lines up with character boundaries in the EUC code. And dst gets padded with null characters at the end if possible. Both src and dst are represented using EUC code. iykyk.
RkwCvtHan is literally just the wchar_t version of RkCvtHan. Same energy, different type. The arguments that specify a length are regarded as counting character length instead of byte length. π
And here's the wild part β NULL can be specified in dst. When you do that, NULL overrides the entire conversion result. Like, no result for you. π
π₯ RETURN VALUE π₯
This function returns the byte length of the conversion result β or the character length if you're using RkwCvtHan. π
But if the value of maxdst is invalid? It returns 0. That's it. That's the whole story. π
π SEE ALSO π
(no cap, the original doesn't list any other pages here β just the vibes)
This was RKCVTHAN(3) from the Library Functions Manual, brought to you with love, and no cap whatsoever. Thanks for reading bestie, you ate. π
β¨π¦ππ
π¦ where this page comes from
- debian bookworm: libcanna1g-dev 3.7p3-20 Β· ISC
- debian trixie: libcanna1g-dev 3.7p3-25 Β· ISC
- ubuntu jammy: libcanna1g-dev 3.7p3-17 Β· ISC
- ubuntu noble: libcanna1g-dev 3.7p3-20 Β· ISC
- ubuntu questing: libcanna1g-dev 3.7p3-26
- ubuntu resolute: libcanna1g-dev 3.7p3-26build1 Β· ISC
- ubuntu stonking: libcanna1g-dev 3.7p3-29 Β· ISC
- Copyright 1994 NEC Corporation, Tokyo, Japan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms