19b2f0aebSSascha Wildner.\"- 28a84c799SMatthew Dillon.\" Copyright (c) 2015 Matthew Dillon 38a84c799SMatthew Dillon.\" All rights reserved. 48a84c799SMatthew Dillon.\" 58a84c799SMatthew Dillon.\" Redistribution and use in source and binary forms, with or without 68a84c799SMatthew Dillon.\" modification, are permitted provided that the following conditions 78a84c799SMatthew Dillon.\" are met: 88a84c799SMatthew Dillon.\" 1. Redistributions of source code must retain the above copyright 98a84c799SMatthew Dillon.\" notice, this list of conditions and the following disclaimer. 108a84c799SMatthew Dillon.\" 2. Redistributions in binary form must reproduce the above copyright 118a84c799SMatthew Dillon.\" notice, this list of conditions and the following disclaimer in the 128a84c799SMatthew Dillon.\" documentation and/or other materials provided with the distribution. 138a84c799SMatthew Dillon.\" 148a84c799SMatthew Dillon.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 158a84c799SMatthew Dillon.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 168a84c799SMatthew Dillon.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 178a84c799SMatthew Dillon.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 188a84c799SMatthew Dillon.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 198a84c799SMatthew Dillon.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 208a84c799SMatthew Dillon.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 218a84c799SMatthew Dillon.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 228a84c799SMatthew Dillon.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 238a84c799SMatthew Dillon.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 248a84c799SMatthew Dillon.\" SUCH DAMAGE. 258a84c799SMatthew Dillon.\" 268e1af606SSascha Wildner.Dd August 24, 2015 278a84c799SMatthew Dillon.Dt MBINTOWCR 3 288a84c799SMatthew Dillon.Os 298a84c799SMatthew Dillon.Sh NAME 308a84c799SMatthew Dillon.Nm mbintowcr , 318a84c799SMatthew Dillon.Nm mbintowcr_l , 328a84c799SMatthew Dillon.Nm utf8towcr , 338a84c799SMatthew Dillon.Nm wcrtombin , 348a84c799SMatthew Dillon.Nm wcrtombin_l , 358a84c799SMatthew Dillon.Nm wcrtoutf8 368a84c799SMatthew Dillon.Nd "8-bit-clean wchar conversion w/escaping or validation" 378a84c799SMatthew Dillon.Sh LIBRARY 388a84c799SMatthew Dillon.Lb libc 398a84c799SMatthew Dillon.Sh SYNOPSIS 408a84c799SMatthew Dillon.In wchar.h 418a84c799SMatthew Dillon.Ft size_t 428a84c799SMatthew Dillon.Fo mbintowcr 438a84c799SMatthew Dillon.Fa "wchar_t * restrict dst" "const char * restrict src" 448a84c799SMatthew Dillon.Fa "size_t dlen" "size_t *slen" "int flags" 458a84c799SMatthew Dillon.Fc 467fc94fc3SSascha Wildner.Ft size_t 478a84c799SMatthew Dillon.Fo utf8towcr 488a84c799SMatthew Dillon.Fa "wchar_t * restrict dst" "const char * restrict src" 498a84c799SMatthew Dillon.Fa "size_t dlen" "size_t *slen" "int flags" 508a84c799SMatthew Dillon.Fc 518a84c799SMatthew Dillon.Ft size_t 528a84c799SMatthew Dillon.Fo wcrtombin 538a84c799SMatthew Dillon.Fa "char * restrict dst" "const wchar_t * restrict src" 548a84c799SMatthew Dillon.Fa "size_t dlen" "size_t *slen" "int flags" 558a84c799SMatthew Dillon.Fc 567fc94fc3SSascha Wildner.Ft size_t 578a84c799SMatthew Dillon.Fo wcrtoutf8 588a84c799SMatthew Dillon.Fa "char * restrict dst" "const wchar_t * restrict src" 598a84c799SMatthew Dillon.Fa "size_t dlen" "size_t *slen" "int flags" 608a84c799SMatthew Dillon.Fc 618e1af606SSascha Wildner.In xlocale.h 628e1af606SSascha Wildner.Ft size_t 638e1af606SSascha Wildner.Fo mbintowcr_l 648e1af606SSascha Wildner.Fa "wchar_t * restrict dst" "const char * restrict src" 658e1af606SSascha Wildner.Fa "size_t dlen" "size_t *slen" "locale_t locale" "int flags" 668e1af606SSascha Wildner.Fc 678e1af606SSascha Wildner.Ft size_t 688e1af606SSascha Wildner.Fo wcrtombin_l 698e1af606SSascha Wildner.Fa "char * restrict dst" "const wchar_t * restrict src" 708e1af606SSascha Wildner.Fa "size_t dlen" "size_t *slen" "locale_t locale" "int flags" 718e1af606SSascha Wildner.Fc 728a84c799SMatthew Dillon.Sh DESCRIPTION 738a84c799SMatthew DillonThe 748a84c799SMatthew Dillon.Fn mbintowcr 758a84c799SMatthew Dillonand 768a84c799SMatthew Dillon.Fn wcrtombin 778a84c799SMatthew Dillonfunctions translate byte data into wide-char format and back again. 788a84c799SMatthew DillonUnder normal conditions (but not with all flags) these functions 798a84c799SMatthew Dillonguarantee that the round-trip will be 8-bit-clean. 809b2f0aebSSascha WildnerSome care must be taken to properly specify the 819b2f0aebSSascha Wildner.Dv WCSBIN_EOF 829b2f0aebSSascha Wildnerflag to properly handle trailing incomplete sequences at stream EOF. 838a84c799SMatthew Dillon.Pp 848a84c799SMatthew DillonFor the "C" locale these functions are 1:1 (do not convert UTF-8). 859b2f0aebSSascha WildnerFor UTF-8 locales these functions convert to/from UTF-8. 869b2f0aebSSascha WildnerMost of the discussion below pertains to UTF-8 translations. 878a84c799SMatthew Dillon.Pp 888a84c799SMatthew DillonThe 898a84c799SMatthew Dillon.Fn utf8towcr 908a84c799SMatthew Dillonand 918a84c799SMatthew Dillon.Fn wcrtoutf8 928a84c799SMatthew Dillonfunctions do exactly the same thing as the above functions but are locked 939b2f0aebSSascha Wildnerto the UTF-8 locale. 949b2f0aebSSascha WildnerThat is, these functions work regardless of which localehas been selected 959b2f0aebSSascha Wildnerand also do not require any initial 969b2f0aebSSascha Wildner.Fn setlocale 979b2f0aebSSascha Wildnercall to initialize. 989b2f0aebSSascha WildnerApplications working explicitly in UTF-8 should use these versions. 998a84c799SMatthew Dillon.Pp 1008a84c799SMatthew DillonAny illegal sequences will be escaped using UTF-8B (U+DC80 - U+DCFF). 1018a84c799SMatthew DillonIllegal sequences include surrogate-space encodings, non-canonical encodings, 1028a84c799SMatthew Dilloncodings >= 0x10FFFF, 5-byte and 6-byte codings (which are not legal anymore), 1038a84c799SMatthew Dillonand malformed codings. 1048a84c799SMatthew DillonFlags may be used to modify this behavior. 1058a84c799SMatthew Dillon.Pp 1068a84c799SMatthew DillonThe 1078a84c799SMatthew Dillon.Fn mbintowcr 1088a84c799SMatthew Dillonfunction takes generic 8-bit byte data as its input which the caller 1098a84c799SMatthew Dillonexpects to be loosely coded in UTF-8 and converts it to an array of 1109b2f0aebSSascha Wildner.Vt wchar_t , 1119b2f0aebSSascha Wildnerand returns the number of 1129b2f0aebSSascha Wildner.Vt wchar_t 1139b2f0aebSSascha Wildnerthat were converted. 1148a84c799SMatthew DillonThe caller must set 1158a84c799SMatthew Dillon.Fa *slen 1168a84c799SMatthew Dillonto the number of bytes in the input buffer and the function will 1178a84c799SMatthew Dillonset 1188a84c799SMatthew Dillon.Fa *slen 1198a84c799SMatthew Dillonon return to the number of bytes in the input buffer that were processed. 1208a84c799SMatthew Dillon.Pp 1218a84c799SMatthew DillonFewer bytes than specified might be processed due to the output buffer 1228a84c799SMatthew Dillonreaching its limit or due to an incomplete sequence at the end of the input 1239b2f0aebSSascha Wildnerbuffer when the 1249b2f0aebSSascha Wildner.Dv WCSBIN_EOF 1259b2f0aebSSascha Wildnerflag has not been specified. 1268a84c799SMatthew Dillon.Pp 1278a84c799SMatthew DillonIf processing a stream, the caller 1288a84c799SMatthew Dillontypically copies any unprocessed data at the end of the buffer back to 1298a84c799SMatthew Dillonthe beginning and then continues loading the buffer from there. 1308a84c799SMatthew DillonBe sure to check for an incomplete translation at stream EOF and do a 1319b2f0aebSSascha Wildnerfinal translation of the remainder with the 1329b2f0aebSSascha Wildner.Dv WCSBIN_EOF 1339b2f0aebSSascha Wildnerflag set. 1348a84c799SMatthew Dillon.Pp 1359b2f0aebSSascha WildnerThis function will always generate escapes for illegal UTF-8 code sequences 1369b2f0aebSSascha Wildnerand by can produce a clean BYTE-WCHAR-BYTE conversion. 1379b2f0aebSSascha WildnerSee the flags description later on. 1388a84c799SMatthew Dillon.Pp 1399b2f0aebSSascha WildnerThis function cannot return an error unless the 1409b2f0aebSSascha Wildner.Dv WCSBIN_STRICT 1419b2f0aebSSascha Wildnerflag is set. 1428a84c799SMatthew DillonIn case of error, any valid conversions are returned first and the caller 1439b2f0aebSSascha Wildneris expected to iterate. 1449b2f0aebSSascha WildnerThe error is returned when it becomes the first element of the buffer. 1458a84c799SMatthew Dillon.Pp 1468a84c799SMatthew DillonA 1478a84c799SMatthew Dillon.Dv NULL 1488a84c799SMatthew Dillondestination buffer may be specified in which case this function operates 1499b2f0aebSSascha Wildneridentically except for actually trying to fill the buffer. 1509b2f0aebSSascha WildnerThis feature is typically used for validation with 1519b2f0aebSSascha Wildner.Dv WCSBIN_STRICT 1529b2f0aebSSascha Wildnerand sometimes also used in combination with 1539b2f0aebSSascha Wildner.Dv WCSBIN_SURRO 1549b2f0aebSSascha Wildner(set if you want to allow surrogates). 1558a84c799SMatthew Dillon.Pp 1568a84c799SMatthew DillonThe 1578a84c799SMatthew Dillon.Fn wcrtombin 1589b2f0aebSSascha Wildnerfunction takes an array of 1599b2f0aebSSascha Wildner.Vt wchar_t 1609b2f0aebSSascha Wildneras its input which is usually expected to be well-formed and converts it 1619b2f0aebSSascha Wildnerto an array of generic 8-bit byte data. 1628a84c799SMatthew DillonThe caller must set 1638a84c799SMatthew Dillon.Fa *slen 1649b2f0aebSSascha Wildnerto the number of elements in the input buffer and the function will set 1658a84c799SMatthew Dillon.Fa *slen 1668a84c799SMatthew Dillonon return to the number of elements in the input buffer that were processed. 1678a84c799SMatthew Dillon.Pp 1689b2f0aebSSascha WildnerBe sure to properly set the 1699b2f0aebSSascha Wildner.Dv WCSBIN_EOF 1709b2f0aebSSascha Wildnerflag for the last buffer at stream EOF. 1718a84c799SMatthew Dillon.Pp 1728a84c799SMatthew DillonThis function can return an error regardless of the flags if a supplied 1739b2f0aebSSascha Wildnerwchar code is out of range. 1749b2f0aebSSascha WildnerSome flags change the range of allowed wchar codes. 1759b2f0aebSSascha WildnerIn case of error, any valid conversions are returned first and the 1769b2f0aebSSascha Wildnercaller is expected to iterate. 1779b2f0aebSSascha WildnerThe error is returned when it becomes the first element of the buffer. 1788a84c799SMatthew Dillon.Pp 1798a84c799SMatthew DillonA 1808a84c799SMatthew Dillon.Dv NULL 1818a84c799SMatthew Dillondestination buffer may be specified in which case this function operates 1829b2f0aebSSascha Wildneridentically except for actually trying to fill the buffer. 1839b2f0aebSSascha WildnerThis feature is typically used for validation with or without 1849b2f0aebSSascha Wildner.Dv WCSBIN_STRICT 1859b2f0aebSSascha Wildnerand sometimes also used in combination with 1869b2f0aebSSascha Wildner.Dv WCSBIN_SURRO . 1878a84c799SMatthew Dillon.Pp 1889b2f0aebSSascha WildnerOne final note on the use of 1899b2f0aebSSascha Wildner.Dv WCSBIN_SURRO 1909b2f0aebSSascha Wildnerfor wchars-to-bytes. 1919b2f0aebSSascha WildnerIf this flag 1928a84c799SMatthew Dillonis not set surrogates in the escape range will be de-escaped (giving us our 1939b2f0aebSSascha Wildner8-bit-clean round-trip), and other surrogates will be passed through as UTF-8 1949b2f0aebSSascha Wildnerencodings. 1959b2f0aebSSascha WildnerIn 1969b2f0aebSSascha Wildner.Dv WCSBIN_STRICT 1979b2f0aebSSascha Wildnermode this flag works slightly differently. 1988a84c799SMatthew DillonIf not specified no surrogates are allowed at all (escaped or otherwise), 1998a84c799SMatthew Dillonand if specified all surrogates are allowed and will never be de-escaped. 2008e1af606SSascha Wildner.Pp 2018e1af606SSascha WildnerThe _l-suffixed versions of 2028e1af606SSascha Wildner.Fn mbintowcr 2038e1af606SSascha Wildnerand 2048e1af606SSascha Wildner.Fn wcrtombin 2058e1af606SSascha Wildnertake an explicit 2068e1af606SSascha Wildner.Fa locale 2078e1af606SSascha Wildnerargument, whereas the 2088e1af606SSascha Wildnernon-suffixed versions use the current global or per-thread locale. 2098a84c799SMatthew Dillon.Sh UTF-8B ESCAPE SEQUENCES 2108a84c799SMatthew DillonEscaping is handled by converting one or more bytes in the byte sequence to 2119b2f0aebSSascha Wildnerthe UTF-8B escape wchar (U+DC80 - U+DCFF). 2129b2f0aebSSascha WildnerMost illegal sequences escape the first byte and then reprocess the remaining 2139b2f0aebSSascha Wildnerbytes. 2149b2f0aebSSascha WildnerAn illegal byte 2158a84c799SMatthew Dillonsequence length (5 or 6 bytes), non-canonical encoding, or illegal wchar value 2168a84c799SMatthew Dillon(beyond 0x10FFFF if not modified by flags) will escape all bytes in the 2178a84c799SMatthew Dillonsequence as long as they were not malformed. 2188a84c799SMatthew Dillon.Pp 2198a84c799SMatthew DillonWhen converting back to a byte-sequence, if not modified by flags, UTF-8B 2209b2f0aebSSascha Wildnerescape wchars are converted back to their original bytes. 2219b2f0aebSSascha WildnerOther surrogate codes (U+D800 - U+DFFF which are normally illegal) will be 2229b2f0aebSSascha Wildnerpassed through and encoded as UTF-8. 2238a84c799SMatthew Dillon.Sh FLAGS 2249b2f0aebSSascha Wildner.Bl -tag -width ".Dv WCSBIN_LONGCODES" 2259b2f0aebSSascha Wildner.It Dv WCSBIN_EOF 2268a84c799SMatthew DillonIndicate that the input buffer represents the last of the input stream. 2278a84c799SMatthew DillonThis causes any partial sequences at the end of the input buffer to be 2288a84c799SMatthew Dillonprocessed. 2299b2f0aebSSascha Wildner.It Dv WCSBIN_SURRO 2309b2f0aebSSascha WildnerThis flag passes-through any surrogate codes that are already UTF-8-encoded. 2318a84c799SMatthew DillonThis is normally illegal but if you are processing a stream which has already 2329b2f0aebSSascha Wildnerbeen UTF-8B escaped this flag will prevent the U+DC80 - U+DCFF codes from 2338a84c799SMatthew Dillonbeing re-escaped bytes-to-wchars and will prevent decoding back to the 2349b2f0aebSSascha Wildneroriginal bytes wchars-to-bytes. 2359b2f0aebSSascha WildnerThis flag is sometimes used on input if the 2368a84c799SMatthew Dilloncaller expects the input stream to already be escaped, and not usually used 2378a84c799SMatthew Dillonon output unless the caller explicitly wants to encode to an intermediate 2389b2f0aebSSascha Wildnerillegal UTF-8 encoding that retains the escapes as escapes. 2398a84c799SMatthew Dillon.Pp 2408a84c799SMatthew DillonThis flag does not prevent additional escapes from being translated on 2419b2f0aebSSascha Wildnerbytes-to-wchars 2429b2f0aebSSascha Wildner.Dv ( WCSBIN_STRICT 2439b2f0aebSSascha Wildnerprevents escaping on bytes-to-wchars), but 2448a84c799SMatthew Dillonwill prevent de-escaping on wchars-to-bytes. 2458a84c799SMatthew Dillon.Pp 2468a84c799SMatthew DillonThis flag breaks round-trip 8-bit-clean operation since escape codes use 2478a84c799SMatthew Dillonthe surrogate space and will mix with surrogates that are passed through 2488a84c799SMatthew Dillonon input by this flag in a way that cannot be distinguished. 2499b2f0aebSSascha Wildner.It Dv WCSBIN_LONGCODES 2508a84c799SMatthew DillonSpecifying this flag in the bytes-to-wchars direction allows for decoding 2518a84c799SMatthew Dillonof legacy 5-byte and 6-byte sequences as well as 4-byte sequences which 2529b2f0aebSSascha Wildnerwould normally be illegal. 2539b2f0aebSSascha WildnerThese sequences are illegal and this flag should 2548a84c799SMatthew Dillonnot normally be used unless the caller explicitly wants to handle the legacy 2558a84c799SMatthew Dilloncase. 2568a84c799SMatthew Dillon.Pp 2578a84c799SMatthew DillonSpecifying this flag in the wchars-to-bytes direction allows normally illegal 2589b2f0aebSSascha Wildnerwchars to be encoded. 2599b2f0aebSSascha WildnerAgain, not recommended. 2608a84c799SMatthew Dillon.Pp 2619b2f0aebSSascha WildnerThis flag does not allow decoding non-canonical sequences. 2629b2f0aebSSascha WildnerSuch sequences will still be escaped. 2639b2f0aebSSascha Wildner.It Dv WCSBIN_STRICT 2648a84c799SMatthew DillonThis flag forces strict parsing in the bytes-to-wchars direction and will 2658a84c799SMatthew Dilloncause 2668a84c799SMatthew Dillon.Fn mbintowcr 267*7c5aac38SSascha Wildnerto process short or return with an error once processing reaches the 2688a84c799SMatthew Dillonillegal coding rather than escaping the illegal sequence. 2698a84c799SMatthew DillonThis flag is usually specified only when the caller desires to validate 2709b2f0aebSSascha Wildnera UTF-8 buffer. 2719b2f0aebSSascha WildnerRemember that an error may also be present with return values greater than 0. 2729b2f0aebSSascha WildnerA partial sequences at the end of the buffer is not 2739b2f0aebSSascha Wildnerconsidered to be an error unless 2749b2f0aebSSascha Wildner.Dv WCSBIN_EOF 2759b2f0aebSSascha Wildneris also specified. 2768a84c799SMatthew Dillon.Pp 2778a84c799SMatthew DillonCaller is reminded that when using this feature for validation, a 2788a84c799SMatthew Dillonshort-return can happen rather than an error if the error is not at the 2799b2f0aebSSascha Wildnerbase of the source or if 2809b2f0aebSSascha Wildner.Dv WCSBIN_EOF 2819b2f0aebSSascha Wildneris not specified. 2829b2f0aebSSascha WildnerIf the caller is not chaining buffers then 2839b2f0aebSSascha Wildner.Dv WCSBIN_EOF 2849b2f0aebSSascha Wildnershould be specified and a simple check of whether 2858a84c799SMatthew Dillon.Fa *slen 2868a84c799SMatthew Dillonequals the original input buffer length on return is sufficient to determine 2879b2f0aebSSascha Wildnerif an error occurred or not. 2889b2f0aebSSascha WildnerIf the caller is chaining buffers 2899b2f0aebSSascha Wildner.Dv WCSBIN_EOF 2908a84c799SMatthew Dillonis not specified and the caller must proceed with the copy-down / continued 2918a84c799SMatthew Dillonbuffer loading loop to distinguish between an incomplete buffer and an error. 2928a84c799SMatthew Dillon.El 2938a84c799SMatthew Dillon.Sh RETURN VALUES 2948a84c799SMatthew DillonThe 2958e1af606SSascha Wildner.Fn mbintowcr , 2968e1af606SSascha Wildner.Fn mbintowcr_l , 2978e1af606SSascha Wildner.Fn utf8towcr , 2988e1af606SSascha Wildner.Fn wcrtombin , 2998e1af606SSascha Wildner.Fn wcrtombin_l 3008a84c799SMatthew Dillonand 3018e1af606SSascha Wildner.Fn wcrtoutf8 3029b2f0aebSSascha Wildnerfunctions return the number of output elements generated and set 3039b2f0aebSSascha Wildner.Fa *slen 3049b2f0aebSSascha Wildnerto the number of input elements converted. 3058a84c799SMatthew DillonIf an error occurs but the output buffer has already been populated, 3068a84c799SMatthew Dillona short return will occur and the next iteration where the error is 3079b2f0aebSSascha Wildnerthe first element will return the error. 3089b2f0aebSSascha WildnerThe caller is responsible for processing any error conditions before 3099b2f0aebSSascha Wildnercontinuing. 3108a84c799SMatthew Dillon.Pp 3118a84c799SMatthew DillonThe 3128e1af606SSascha Wildner.Fn mbintowcr , 3138e1af606SSascha Wildner.Fn mbintowcr_l 3148e1af606SSascha Wildnerand 3158e1af606SSascha Wildner.Fn utf8towcr 3169b2f0aebSSascha Wildnerfunctions can return a (size_t)-1 error if 3179b2f0aebSSascha Wildner.Dv WCSBIN_STRICT 3189b2f0aebSSascha Wildneris specified, and otherwise cannot. 3198e1af606SSascha Wildner.Pp 3208a84c799SMatthew DillonThe 3218e1af606SSascha Wildner.Fn wcrtombin , 3228e1af606SSascha Wildner.Fn wcrtombin_l 3238e1af606SSascha Wildnerand 3248e1af606SSascha Wildner.Fn wcrtoutf8 3258e1af606SSascha Wildnerfunctions can return a (size_t)-1 error if given an illegal wchar code, 3269b2f0aebSSascha Wildneras modified by 3279b2f0aebSSascha Wildner.Fa flags . 3289b2f0aebSSascha WildnerAny wchar code >= 0x80000000U always causes an error to be returned. 3298a84c799SMatthew Dillon.Sh ERRORS 3309b2f0aebSSascha WildnerIf an error is returned, errno will be set to 3319b2f0aebSSascha Wildner.Er EILSEQ . 3328a84c799SMatthew Dillon.Sh SEE ALSO 3338a84c799SMatthew Dillon.Xr mbtowc 3 , 3348a84c799SMatthew Dillon.Xr multibyte 3 , 3358a84c799SMatthew Dillon.Xr setlocale 3 , 3368a84c799SMatthew Dillon.Xr wcrtomb 3 , 3378a84c799SMatthew Dillon.Xr xlocale 3 3388a84c799SMatthew Dillon.Sh STANDARDS 3398a84c799SMatthew DillonThe 3408e1af606SSascha Wildner.Fn mbintowcr , 3418e1af606SSascha Wildner.Fn mbintowcr_l , 3428e1af606SSascha Wildner.Fn utf8towcr , 3438e1af606SSascha Wildner.Fn wcrtombin , 3448e1af606SSascha Wildner.Fn wcrtombin_l 3458a84c799SMatthew Dillonand 3468e1af606SSascha Wildner.Fn wcrtoutf8 3478a84c799SMatthew Dillonfunctions are non-standard extensions to libc. 348