# towctrans

## PROLOG



           This manual page is part of the POSIX Programmer's Manual.  The
           Linux implementation of this interface may differ (consult the
           corresponding Linux manual page for details of Linux behavior), or
           the interface may not be implemented on Linux.
    


## NAME



           towctrans, towctrans_l — wide-character transliteration
    


## SYNOPSIS



           #include <wctype.h>
    
           wint_t towctrans(wint_t _wc_ , wctrans_t _desc_);
           wint_t towctrans_l(wint_t _wc_ , wctrans_t _desc_ ,
               locale_t _locale_);
    


## DESCRIPTION



           For _towctrans_(): The functionality described on this reference
           page is aligned with the ISO C standard. Any conflict between the
           requirements described here and the ISO C standard is
           unintentional. This volume of POSIX.1‐2017 defers to the ISO C
           standard.
    
           The _towctrans_() and _towctrans_l_() functions shall transliterate
           the wide-character code _wc_ using the mapping described by _desc_.
    
           The current setting of the _LC_CTYPE_ category in the current locale
           or in the locale represented by _locale_ , respectively, should be
           the same as during the call to _wctrans_() or _wctrans_l_() that
           returned the value _desc_.
    
           If the value of _desc_ is invalid (that is, not obtained by a call
           to _wctrans_() or _desc_ is invalidated by a subsequent call to
           _setlocale_() that has affected category _LC_CTYPE_), the result is
           unspecified.
    
           If the value of _desc_ is invalid (that is, not obtained by a call
           to _wctrans_l_() with the same locale object _locale_) the result is
           unspecified.
    
           An application wishing to check for error situations should set
           _errno_ to 0 before calling _towctrans_() or _towctrans_l_().
    
           If _errno_ is non-zero on return, an error has occurred.
    
           The behavior is undefined if the _locale_ argument to _towctrans_l_()
           is the special locale object LC_GLOBAL_LOCALE or is not a valid
           locale object handle.
    


## RETURN VALUE



           If successful, the _towctrans_() and _towctrans_l_() functions shall
           return the mapped value of _wc_ using the mapping described by _desc_.
           Otherwise, they shall return _wc_ unchanged.
    


## ERRORS



           These functions may fail if:
    
           **EINVAL** _desc_ contains an invalid transliteration descriptor.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           The strings **"tolower"** and **"toupper"** are reserved for the standard
           mapping names. In the table below, the functions in the left
           column are equivalent to the functions in the right column.
    
               towlower(_wc_)            towctrans(_wc_ , wctrans("tolower"))
               towlower_l(_wc_ , _locale_)  towctrans_l(_wc_ , wctrans("tolower"), _locale_)
               towupper(_wc_)            towctrans(_wc_ , wctrans("toupper"))
               towupper_l(_wc_ , _locale_)  towctrans_l(_wc_ , wctrans("toupper"), _locale_)
    


## RATIONALE



           None.
    


## FUTURE DIRECTIONS



           None.
    


* * *