C Language: Wide character set operation function

Source: Internet
Author: User
Tags locale setting string format

C Language: Wide character set operation function
(Unicode encoding)

Character classification: Wide character function general C function description
Iswalnum () isalnum () test whether the character is a number or a letter
Iswalpha () Isalpha () test whether the character is a letter
Iswcntrl () Iscntrl () test whether the character is a control
Iswdigit () isdigit () test whether the character is a number
Iswgraph () isgraph () test whether the character is a visible character
Iswlower () islower () test if the character is lowercase characters
Iswprint () isprint () test whether the character is a printable character
Iswpunct () ispunct () test whether the character is a punctuation mark
Iswspace () isspace () test whether the character is a blank symbol
Iswupper () isupper () test whether the character is uppercase characters
Iswxdigit () isxdigit () test whether the character is a hexadecimal digit
Case conversion:
Wide character function general C function description
Towlower () ToLower () converts a character to lowercase
Towupper () ToUpper () converts characters to uppercase
Character comparison: wide character function general C function description
Wcscoll () strcoll () comparison string
Date and Time conversion:
Wide character Function description
Strftime () Formats the date and time according to the specified string format and locale setting
Wcsftime () Formats the date and time according to the specified string format and locale, and returns a wide string
Strptime () Converts a string to a time value according to a specified format, which is the inverse of strftime

Print and Scan strings:
Wide character Function description
fprintf ()/fwprintf () formatted output using the VARARG parameter
FSCANF ()/fwscanf () format read-in
printf () formatted output to standard output using the VARARG parameter
scanf () read from the format of the standard input
sprintf ()/swprintf () formatted as a string according to the vararg parameter table
SSCANF () read in string format
vfprintf ()/vfwprintf () format output to a file using the Stdarg parameter table
vprintf () format output to standard output using the Stdarg parameter table
vsprintf ()/vswprintf () formats the STDARG parameter table and writes to the string
Digital conversions:
Wide character function general C function description
Wcstod () strtod () converts the initial part of a wide character to a double-precision floating-point number
Wcstol () strtol () converts the initial part of a wide character to a long integer
Wcstoul () Strtoul () converts the initial part of a wide character to an unsigned long integer
Multibyte character and wide character conversion and manipulation:
Wide character Function description
Mblen () determines the number of bytes of a character based on locale settings
MBSTOWCS () converts multibyte strings to wide strings
MBTOWC ()/BTOWC () converts multi-byte characters to wide characters
Wcstombs () converts a wide string to a multibyte string
Wctomb ()/wctob () converts wide characters to multibyte characters

Input and output:
Wide character function general C function description
FGETWC () fgetc () reads a character from the stream and converts it into a wide character
Fgetws () fgets () reads a string from the stream and converts it into a wide string
FPUTWC () FPUTC () converts wide characters to multibyte characters and outputs to standard output
Fputws () fputs () converts a wide string to multibyte characters and outputs to a standard output string
GETWC () getc () reads characters from standard input and converts them to wide characters
Getwchar () GetChar () reads characters from standard input and converts them to wide characters
None gets () use FGETWS ()
PUTWC () PUTC () converts wide characters to multibyte characters and writes to standard output
Putwchar () Putchar () converts wide characters to multibyte characters and writes to standard output
None puts () use FPUTWS ()
UNGETWC () ungetc () descriptors a wide character back into the input stream
String manipulation:
Wide character function general C function description
Wcscat () strcat () A string to the tail of another string
Wcsncat () Strncat () is similar to Wcscat () and specifies the glue length of the bonded string.
WCSCHR () STRCHR () finds the first position of a substring
WCSRCHR () STRRCHR () finds the first occurrence of a substring starting at the tail
WCSPBRK () strpbrk () finds the position of the first occurrence of any character in another string from a character string
Wcswcs ()/wcsstr () STRCHR () finds the position of the first occurrence of another string in a string
WCSCSPN () strcspn () returns the initial number that does not contain a second string
WCSSPN () strspn () returns the initial number containing the second string
wcscpy () strcpy () copy string
wcsncpy () strncpy () similar to wcscpy (), specifying the number of copies
WCSCMP () strcmp () Comparison of two wide strings
WCSNCMP () strncmp () is similar to wcscmp () and also specifies the number of comparison character strings
Wcslen () strlen () Gets the number of wide strings
Wcstok () strtok () breaks a wide string into a series of strings based on the identifier
Wcswidth () None Gets the width of the wide string
Wcwidth () None Gets the width of the wide character
In addition there are wmemcpy (), WMEMCHR (), wmemcmp (), Wmemmove (), Wmemset (for memory operation)

C Language: Wide character set operation function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.