caca_charset - Online Linux Manual PageSection : 3caca
Updated : Tue Jan 26 2021
Source : Version 0.99.beta19
Note : libcaca

NAMEcaca_charset − libcaca character set conversions

SYNOPSIS

Moduleslibcaca primitives drawing

Functions__extern uint32_t caca_utf8_to_utf32 (char const *, size_t *)
Convert a UTF-8 character to UTF-32​.
__extern size_t caca_utf32_to_utf8 (char *, uint32_t)
Convert a UTF-32 character to UTF-8​.
__extern uint8_t caca_utf32_to_cp437 (uint32_t)
Convert a UTF-32 character to CP437​.
__extern uint32_t caca_cp437_to_utf32 (uint8_t)
Convert a CP437 character to UTF-32​.
__extern char caca_utf32_to_ascii (uint32_t)
Convert a UTF-32 character to ASCII​.
__extern int caca_utf32_is_fullwidth (uint32_t)
Tell whether a UTF-32 character is fullwidth​.

Detailed DescriptionThese functions perform conversions between usual character sets​.

Function Documentation

__extern uint32_t caca_utf8_to_utf32 (char const * s, size_t * bytes)Convert a UTF-8 character read from a string and return its value in the UTF-32 character set​. If the second argument is not null, the total number of read bytes is written in it​. If a null byte was reached before the expected end of the UTF-8 sequence, this function returns zero and the number of read bytes is set to zero​. This function never fails, but its behaviour with illegal UTF-8 sequences is undefined​. Parameters s A string containing the UTF-8 character​.
bytes A pointer to a size_t to store the number of bytes in the character, or NULL​.
Returns The corresponding UTF-32 character, or zero if the character is incomplete​. Referenced by caca_put_str()​.

__extern size_t caca_utf32_to_utf8 (char * buf, uint32_t ch)Convert a UTF-32 character read from a string and write its value in the UTF-8 character set into the given buffer​. This function never fails, but its behaviour with illegal UTF-32 characters is undefined​. Parameters buf A pointer to a character buffer where the UTF-8 sequence will be written​.
ch The UTF-32 character​.
Returns The number of bytes written​.

__extern uint8_t caca_utf32_to_cp437 (uint32_t ch)Convert a UTF-32 character read from a string and return its value in the CP437 character set, or '?' if the character has no equivalent​. This function never fails​. Parameters ch The UTF-32 character​. Returns The corresponding CP437 character, or '?' if not representable​.

__extern uint32_t caca_cp437_to_utf32 (uint8_t ch)Convert a CP437 character read from a string and return its value in the UTF-32 character set, or zero if the character is a CP437 control character​. This function never fails​. Parameters ch The CP437 character​. Returns The corresponding UTF-32 character, or zero if not representable​.

__extern char caca_utf32_to_ascii (uint32_t ch)Convert a UTF-32 character into an ASCII character​. When no equivalent exists, a graphically close equivalent is sought​. This function never fails, but its behaviour with illegal UTF-32 characters is undefined​. Parameters ch The UTF-32 character​. Returns The corresponding ASCII character, or a graphically close equivalent if found, or '?' if not representable​.

__extern int caca_utf32_is_fullwidth (uint32_t ch)Check whether the given UTF-32 character should be printed at twice the normal width (fullwidth characters)​. If the character is unknown or if its status cannot be decided, it is treated as a standard-width character​. This function never fails​. Parameters ch The UTF-32 character​. Returns 1 if the character is fullwidth, 0 otherwise​. Referenced by caca_put_char(), and caca_put_str()​.

AuthorGenerated automatically by Doxygen for libcaca from the source code​.
0
Johanes Gumabo
Data Size   :   17,635 byte
man-caca_cp437_to_utf32.3cacaBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 189,635
Visitor ID   :     :  
Visitor IP   :   3.144.255.198   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.