Add .gitattributes and .gitignore files and normalize line endings in the repository...
[reactos.git] / sdk / lib / 3rdparty / stlport / doc / README.utf8
index 8ae3e77..7547fe9 100644 (file)
@@ -1,51 +1,51 @@
-  Here is a description of how you can use STLport to read/write utf8 files.\r
-utf8 is a way of encoding wide characters. As so, management of encoding in\r
-the C++ Standard library is handle by the codecvt locale facet which is part\r
-of the ctype category. However utf8 only describe how encoding must be\r
-performed, it cannot be used to classify characters so it is not enough info\r
-to know how to generate the whole ctype category facets of a locale\r
-instance.\r
-\r
-In C++ it means that the following code will throw an exception to\r
-signal that creation failed:\r
-\r
-#include <locale>\r
-// Will throw a std::runtime_error exception.\r
-std::locale loc(".utf8");\r
-\r
-For the same reason building a locale with the ctype facets based on\r
-UTF8 is also wrong:\r
-\r
-// Will throw a std::runtime_error exception:\r
-std::locale loc(locale::classic(), ".utf8", std::locale::ctype);\r
-\r
-The only solution to get a locale instance that will handle utf8 encoding\r
-is to specifically signal that the codecvt facet should be based on utf8\r
-encoding:\r
-\r
-// Will succeed if there is necessary platform support.\r
-locale loc(locale::classic(), new codecvt_byname<wchar_t, char, mbstate_t>(".utf8"));\r
-\r
-  Once you have obtain a locale instance you can inject it in a file stream to\r
-read/write utf8 files:\r
-\r
-std::fstream fstr("file.utf8");\r
-fstr.imbue(loc);\r
-\r
-You can also access the facet directly to perform utf8 encoding/decoding operations:\r
-\r
-typedef std::codecvt<wchar_t, char, mbstate_t> codecvt_t;\r
-const codecvt_t& encoding = use_facet<codecvt_t>(loc);\r
-\r
-Notes:\r
-\r
-1. The dot ('.') is mandatory in front of utf8. This is a POSIX convention, locale\r
-names have the following format:\r
-language[_country[.encoding]]\r
-\r
-Ex: 'fr_FR'\r
-    'french'\r
-    'ru_RU.koi8r'\r
-\r
-2. utf8 encoding is only supported for the moment under Windows. The less common\r
-utf7 encoding is also supported.\r
+  Here is a description of how you can use STLport to read/write utf8 files.
+utf8 is a way of encoding wide characters. As so, management of encoding in
+the C++ Standard library is handle by the codecvt locale facet which is part
+of the ctype category. However utf8 only describe how encoding must be
+performed, it cannot be used to classify characters so it is not enough info
+to know how to generate the whole ctype category facets of a locale
+instance.
+
+In C++ it means that the following code will throw an exception to
+signal that creation failed:
+
+#include <locale>
+// Will throw a std::runtime_error exception.
+std::locale loc(".utf8");
+
+For the same reason building a locale with the ctype facets based on
+UTF8 is also wrong:
+
+// Will throw a std::runtime_error exception:
+std::locale loc(locale::classic(), ".utf8", std::locale::ctype);
+
+The only solution to get a locale instance that will handle utf8 encoding
+is to specifically signal that the codecvt facet should be based on utf8
+encoding:
+
+// Will succeed if there is necessary platform support.
+locale loc(locale::classic(), new codecvt_byname<wchar_t, char, mbstate_t>(".utf8"));
+
+  Once you have obtain a locale instance you can inject it in a file stream to
+read/write utf8 files:
+
+std::fstream fstr("file.utf8");
+fstr.imbue(loc);
+
+You can also access the facet directly to perform utf8 encoding/decoding operations:
+
+typedef std::codecvt<wchar_t, char, mbstate_t> codecvt_t;
+const codecvt_t& encoding = use_facet<codecvt_t>(loc);
+
+Notes:
+
+1. The dot ('.') is mandatory in front of utf8. This is a POSIX convention, locale
+names have the following format:
+language[_country[.encoding]]
+
+Ex: 'fr_FR'
+    'french'
+    'ru_RU.koi8r'
+
+2. utf8 encoding is only supported for the moment under Windows. The less common
+utf7 encoding is also supported.