---
name: "m17nCharacter"
section: "3m17n"
platform: "linux"
package: "m17n-docs"
version: "1.8.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/m17nCharacter"
---

# m17nCharacter(3m17n)

\- Character objects and API for them.

## NAME

m17nCharacter\_-\_Chara -  - Character objects and API for them.

## SYNOPSIS

### Macros

\#define **MCHAR\_MAX**\
 Maximum character code.

### Functions

MSymbol **mchar\_define\_property** (const char \*name, MSymbol type)\
 Define a character property.  void \* **mchar\_get\_prop** (int c, MSymbol key)\
 Get the value of a character property.  int **mchar\_put\_prop** (int c, MSymbol key, void \*val)\
 Set the value of a character property.  **MCharTable** \* **mchar\_get\_prop\_table** (MSymbol key, MSymbol \*type)\
 Get the char-table for a character property.

### Variables: Keys of character properties

These symbols are used as keys of character properties. \

MSymbol **Mscript**\
 Key for script.  MSymbol **Mname**\
 Key for character name.  MSymbol **Mcategory**\
 Key for general category.  MSymbol **Mcombining\_class**\
 Key for canonical combining class.  MSymbol **Mbidi\_category**\
 Key for bidi category.  MSymbol **Msimple\_case\_folding**\
 Key for corresponding single lowercase character.  MSymbol **Mcomplicated\_case\_folding**\
 Key for corresponding multiple lowercase characters.  MSymbol **Mcased**\
 Key for values used in case operation.  MSymbol **Msoft\_dotted**\
 Key for values used in case operation.  MSymbol **Mcase\_mapping**\
 Key for values used in case operation.  MSymbol **Mblock**\
 Key for script block name.

## Detailed Description

Character objects and API for them.

The m17n library represents a *character* by a character code (an integer). The minimum character code is `0`. The maximum character code is defined by the macro **MCHAR\_MAX**. It is assured that **MCHAR\_MAX** is not smaller than `0x3FFFFF` (22 bits).

Characters `0` to `0x10FFFF` are equivalent to the Unicode characters of the same code values.

A character can have zero or more properties called *character* *properties*. A character property consists of a *key* and a *value*, where key is a symbol and value is anything that can be cast to `(void *)`. 'The character property that belongs to character C and whose key is K' may be shortened to 'the K property of C'. \

## Macro Definition Documentation

### #define MCHAR\_MAX

Maximum character code. The macro **MCHAR\_MAX** gives the maximum character code. \

## Variable Documentation

### MSymbol Mscript

Key for script. The symbol **Mscript** has the name `'script'` and is used as the key of a character property. The value of such a property is a symbol representing the script to which the character belongs.

Each symbol that represents a script has one of the names listed in the *Unicode Technical Report #24*. \

### MSymbol Mname

Key for character name. The symbol **Mname** has the name `'name'` and is used as the key of a character property. The value of such a property is a C-string representing the name of the character. \

### MSymbol Mcategory

Key for general category. The symbol **Mcategory** has the name `'category'` and is used as the key of a character property. The value of such a property is a symbol representing the *general category* of the character.

Each symbol that represents a general category has one of the names listed as abbreviations for *General Category* in Unicode. \

### MSymbol Mcombining\_class

Key for canonical combining class. The symbol **Mcombining\_class** has the name `'combining-class'` and is used as the key of a character property. The value of such a property is an integer that represents the *canonical combining class* of the character.

The meaning of each integer that represents a canonical combining class is identical to the one defined in Unicode. \

### MSymbol Mbidi\_category

Key for bidi category. The symbol **Mbidi\_category** has the name `'bidi-category'` and is used as the key of a character property. The value of such a property is a symbol that represents the *bidirectional category* of the character.

Each symbol that represents a bidirectional category has one of the names listed as types of *Bidirectional Category* in Unicode. \

### MSymbol Msimple\_case\_folding

Key for corresponding single lowercase character. The symbol **Msimple\_case\_folding** has the name `'simple-case-folding'` and is used as the key of a character property. The value of such a property is the corresponding single lowercase character that is used when comparing M-texts ignoring cases.

If a character requires a complicated comparison (i.e. cannot be compared by simply mapping to another single character), the value of such a property is `0xFFFF`. In this case, the character has another property whose key is **Mcomplicated\_case\_folding**. \

### MSymbol Mcomplicated\_case\_folding

Key for corresponding multiple lowercase characters. The symbol **Mcomplicated\_case\_folding** has the name `'complicated-case-folding'` and is used as the key of a character property. The value of such a property is the corresponding M-text that contains a sequence of lowercase characters to be used for comparing M-texts ignoring case. \

### MSymbol Mcased

Key for values used in case operation. The symbol **Mcased** has the name `'cased'` and is used as the key of charater property. The value of such a property is an integer value 1, 2, or 3 representing 'cased', 'case-ignorable', and both of them respective. See the Unicode Standard 5.0 (Section 3.13 Default Case Algorithm) for the detail.

### MSymbol Msoft\_dotted

Key for values used in case operation. The symbol **Msoft\_dotted** has the name `'soft-dotted'` and is used as the key of charater property. The value of such a property is **Mt** if a character has 'Soft\_Dotted' property, and **Mnil** otherwise. See the Unicode Standard 5.0 (Section 3.13 Default Case Algorithm) for the detail. \

### MSymbol Mcase\_mapping

Key for values used in case operation. The symbol **Mcase\_mapping** has the name `'case-mapping'` and is used as the key of charater property. The value of such a property is a plist of three M-Texts; lower, title, and upper of the corresponding character. See the Unicode Standard 5.0 (Section 5.18 Case Mappings) for the detail. \

### MSymbol Mblock

Key for script block name. The symbol **Mblock** the name `'block'` and is used as the key of charater property. The value of such a property is a symbol representing a script block of the corresponding character. \

## Author

Generated automatically by Doxygen for The m17n Library from the source code.

## COPYRIGHT

Copyright (C) 2001 Information-technology Promotion Agency (IPA)\
 Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)\
 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License  \<http://www.gnu.org/licenses/fdl.html\>.
