fribidi_remove_bidi_marks(3)
π fribidi_remove_bidi_marks π
okay bestie, so this is a page from the Programmer's Manual for fribidi_remove_bidi_marks(3) β yes the whole page is about one function, and honestly? she's a little icon for it. π
β¨ NAME β¨
fribidi_remove_bidi_marks β remove bidi marks out of a string. that's it, that's the job, and she does it flawlessly. π«Ά
πΈ SYNOPSIS πΈ
#include <../fribidi/lib/fribidi.h>
FriBidiStrIndex fribidi_remove_bidi_marks
(
FriBidiChar *str,
const FriBidiStrIndex len,
FriBidiStrIndex *positions_to_this,
FriBidiStrIndex *position_from_this_list,
FriBidiLevel *embedding_levels
);
like, look at her. five parameters. all of them matter. no notes. π
π¦ PARAMETERS π¦
FriBidiChar *strβ the input string you wanna clean up. give her the messy one, she'll handle it.const FriBidiStrIndex lenβ the input string length. she needs to know how much she's working with, obviously.FriBidiStrIndex *positions_to_thisβ a list mapping positions to the order used instr.FriBidiStrIndex *position_from_this_listβ a list mapping positions from the order used instr.FriBidiLevel *embedding_levelsβ the list of embedding levels. (β οΈ read the description before you go handing her this one, ok?)
π DESCRIPTION π
so what does she actually do? she removes the bidi and boundary-neutral marks out of a string and the accompanying lists. both. together. that's the whole vibe. β¨
she implements rule X9 of the Unicode Bidirectional Algorithm, which lives right here: http://www.unicode.org/reports/tr9/#X9 β with one exception: she also removes U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK. yeah. those too. not me being extra, that's just the spec. π
here's the rundown on the lists:
- if any of the input lists are
NULL, that list is skipped. no drama, she just moves on. - if
stris the visual string, thenpositions_to_thisispositions_L_to_Vandposition_from_this_listispositions_V_to_L. - if
stris the logical string, it's the other way around. - also, the position maps should be filled with valid entries. like, please. valid ones. π
a position map pointing to a removed character gets filled with β1. and btw β you should not use embedding_levels if str is a visual string. nope. don't. π
for best results, run this on a whole paragraph, not on lines. but if you know what you're doing, feel free to do otherwise, bestie β she's not gonna stop you. π§
π RETURNS π
the new length of the string π β or β1 if an error occurred (memory allocation failure, most probably π).
π SEE ALSO π
the whole friend group, fr fr β go say hi:
fribidi_shape_arabic(3)fribidi_get_par_direction(3)fribidi_get_par_embedding_levels_ex(3)fribidi_reorder_line(3)fribidi_get_bidi_type(3)fribidi_get_bidi_types(3)fribidi_get_bidi_type_name(3)fribidi_charset_to_unicode(3)fribidi_unicode_to_charset(3)fribidi_parse_charset(3)fribidi_debug_status(3)fribidi_set_debug(3)fribidi_mirroring_status(3)fribidi_set_mirroring(3)fribidi_reorder_nsm_status(3)fribidi_set_reorder_nsm(3)fribidi_log2vis_get_embedding_levels(3)fribidi_get_type(3)fribidi_get_type_internal(3)fribidi_get_par_embedding_levels(3)fribidi_join_arabic(3)fribidi_get_joining_type(3)fribidi_get_joining_types(3)fribidi_get_joining_type_name(3)fribidi_get_mirror_char(3)fribidi_shape_mirroring(3)fribidi_get_bracket(3)fribidi_get_bracket_types(3)fribidi_shape(3)fribidi_log2vis(3)
okay that's the whole page bestie, you're officially educated π this masterpiece was generated by c2man from fribidi.h, dated 29 October 2026, and it's still filed under fribidi_remove_bidi_marks(3) β go forth and remove those marks, queen πβ¨
π¦ where this page comes from
- arch rolling: fribidi 1.0.18-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms