From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/string%2Fwide%2Ftowctrans.html | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 devdocs/c/string%2Fwide%2Ftowctrans.html (limited to 'devdocs/c/string%2Fwide%2Ftowctrans.html') diff --git a/devdocs/c/string%2Fwide%2Ftowctrans.html b/devdocs/c/string%2Fwide%2Ftowctrans.html new file mode 100644 index 00000000..36a38b2b --- /dev/null +++ b/devdocs/c/string%2Fwide%2Ftowctrans.html @@ -0,0 +1,39 @@ +

towctrans

Defined in header <wctype.h>
wint_t towctrans( wint_t wc, wctrans_t desc );
+
(since C95)

Maps the wide character wc using the current C locale's LC_CTYPE mapping category identified by desc.

+

Parameters

+ + +
wc - the wide character to map
desc - the LC_CTYPE mapping, obtained from a call to wctrans

Return value

The mapped value of wc using the mapping identified by desc in LC_CTYPE facet of the current C locale.

+

Example

#include <locale.h>
+#include <wctype.h>
+#include <wchar.h>
+#include <stdio.h>
+ 
+int main(void)
+{
+    setlocale(LC_ALL, "ja_JP.UTF-8");
+    const wchar_t kana[] = L"ヒラガナ";
+    size_t sz = sizeof kana / sizeof *kana;
+    wchar_t hira[sz];
+    for (size_t n = 0; n < sz; ++n)
+        hira[n] = towctrans(kana[n], wctrans("tojhira"));
+    printf("katakana characters %ls are %ls in hiragana\n", kana, hira);
+}

Output:

+
katakana characters ヒラガナ are ひらがな in hiragana

References

See also

+ +
+
(C95)
looks up a character mapping category in the current C locale
(function)
C++ documentation for towctrans
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/string/wide/towctrans +

+
-- cgit v1.2.3