Pango.Language.from_string
Description: Reference for Pango.Language.from_string

### Function

# Pango.Language.from_string

#### Declaration [src]

    PangoLanguage*
    pango_language_from_string (
      const char* language
    )

#### Description [src]

Convert a language tag to a `PangoLanguage`.

The language tag must be in a RFC-3066 format. `PangoLanguage` pointers can be efficiently copied (copy the pointer) and compared with other language tags (compare the pointer.)

This function first canonicalizes the string by converting it to lowercase, mapping ‘_’ to ‘-‘, and stripping all characters other than letters and ‘-‘.

Use [type_func@Pango.Language.get_default] if you want to get the `PangoLanguage` for the current locale of the process.

#### Parameters

`language` | `const char*`
| a string representing a language tag, or `NULL`
| Can be `NULL`
| Ownership is not transferred to the callee
| The string is a NUL terminated UTF-8 string

#### Return value

Returns: `PangoLanguage`
an opaque pointer to a `PangoLanguage` structure, or `NULL` if `language` was `NULL`. The returned pointer will be valid forever after, and should not be freed.
Ownership is not transferred to the caller
Can be `NULL`