---
name: "fribidi_remove_bidi_marks"
section: "3"
platform: "linux"
package: "fribidi"
version: "1.0.18-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/fribidi_remove_bidi_marks"
---

# fribidi\_remove\_bidi\_marks(3)

remove bidi marks out of a string

## NAME

fribidi\_remove\_bidi\_marks - remove bidi marks out of a string

## 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**\
 **);**

## PARAMETERS

- **FriBidiChar \*str**

  Input string to clean.

- **const FriBidiStrIndex len**

  Input string length.

- **FriBidiStrIndex \*positions\_to\_this**

  List mapping positions to the order used in str.

- **FriBidiStrIndex \*position\_from\_this\_list**

  List mapping positions from the order used in str.

- **FriBidiLevel \*embedding\_levels**

  List of embedding levels.

## DESCRIPTION

This function removes the bidi and boundary-neutral marks out of a string and the accompanying lists.  It implements rule X9 of the Unicode Bidirectional Algorithm available at http://www.unicode.org/reports/tr9/#X9, with the exception that it removes U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK too.

If any of the input lists are NULL, the list is skipped.  If str is the visual string, then positions\_to\_this is  positions\_L\_to\_V and position\_from\_this\_list is positions\_V\_to\_L;  if str is the logical string, the other way. Moreover, the position maps should be filled with valid entries.

A position map pointing to a removed character is filled with −1. By the way, you should not use embedding\_levels if str is visual string.

For best results this function should be run on a whole paragraph, not lines; but feel free to do otherwise if you know what you are doing.

## RETURNS

New length of the string, or −1 if an error occurred (memory allocation failure most probably).

## SEE ALSO

[fribidi\_shape\_arabic(3)](/fribidi_shape_arabic/3.md), [fribidi\_get\_par\_direction(3)](/fribidi_get_par_direction/3.md), [fribidi\_get\_par\_embedding\_levels\_ex(3)](/fribidi_get_par_embedding_levels_ex/3.md), [fribidi\_reorder\_line(3)](/fribidi_reorder_line/3.md), [fribidi\_get\_bidi\_type(3)](/fribidi_get_bidi_type/3.md), [fribidi\_get\_bidi\_types(3)](/fribidi_get_bidi_types/3.md), [fribidi\_get\_bidi\_type\_name(3)](/fribidi_get_bidi_type_name/3.md), [fribidi\_charset\_to\_unicode(3)](/fribidi_charset_to_unicode/3.md), [fribidi\_unicode\_to\_charset(3)](/fribidi_unicode_to_charset/3.md), [fribidi\_parse\_charset(3)](/fribidi_parse_charset/3.md), [fribidi\_debug\_status(3)](/fribidi_debug_status/3.md), [fribidi\_set\_debug(3)](/fribidi_set_debug/3.md), [fribidi\_mirroring\_status(3)](/fribidi_mirroring_status/3.md), [fribidi\_set\_mirroring(3)](/fribidi_set_mirroring/3.md), [fribidi\_reorder\_nsm\_status(3)](/fribidi_reorder_nsm_status/3.md), [fribidi\_set\_reorder\_nsm(3)](/fribidi_set_reorder_nsm/3.md), [fribidi\_log2vis\_get\_embedding\_levels(3)](/fribidi_log2vis_get_embedding_levels/3.md), [fribidi\_get\_type(3)](/fribidi_get_type/3.md), [fribidi\_get\_type\_internal(3)](/fribidi_get_type_internal/3.md), [fribidi\_get\_par\_embedding\_levels(3)](/fribidi_get_par_embedding_levels/3.md), [fribidi\_join\_arabic(3)](/fribidi_join_arabic/3.md), [fribidi\_get\_joining\_type(3)](/fribidi_get_joining_type/3.md), [fribidi\_get\_joining\_types(3)](/fribidi_get_joining_types/3.md), [fribidi\_get\_joining\_type\_name(3)](/fribidi_get_joining_type_name/3.md), [fribidi\_get\_mirror\_char(3)](/fribidi_get_mirror_char/3.md), [fribidi\_shape\_mirroring(3)](/fribidi_shape_mirroring/3.md), [fribidi\_get\_bracket(3)](/fribidi_get_bracket/3.md), [fribidi\_get\_bracket\_types(3)](/fribidi_get_bracket_types/3.md), [fribidi\_shape(3)](/fribidi_shape/3.md), [fribidi\_log2vis(3)](/fribidi_log2vis/3.md)
