Lines Matching defs:encoding

109     /* Oracle Solaris doesn't use Unicode code points as wchar_t encoding
167 /* Workaround FreeBSD and OpenIndiana locale encoding issue with the C locale
169 ASCII encoding, whereas mbstowcs() and wcstombs() functions use the
170 ISO-8859-1 encoding. The problem is that os.fsencode() and os.fsdecode() use
177 one byte in range 0x80-0xff can be decoded from the locale encoding. The
183 ASCII encoding in this case.
215 char encoding[20]; /* longest name: "iso_646.irv_1991\0" */
216 if (!_Py_normalize_encoding(codeset, encoding, sizeof(encoding))) {
221 if (strcmp(encoding, "roman8") == 0) {
231 Latin1 encoding in practice. Force ASCII in this case.
258 if (strcmp(encoding, *alias) == 0) {
277 /* decoding a non-ASCII character from the locale encoding succeed:
278 the locale encoding is not ASCII, force ASCII */
283 encoding: the locale encoding is really ASCII */
292 /* if an error occurred, force the ASCII encoding */
364 *reason = "encoding error";
566 /* Decode a byte string from the locale encoding.
621 /* force ASCII encoding to workaround mbstowcs() issue */
631 /* Decode a byte string from the locale encoding with the
756 *reason = "encoding error";
762 /* Encode a string to the locale encoding.
769 Python filesystem encoding.
776 -2: encoding error, set *error_pos and *reason (if set).
840 /* Encode a wide character string to the locale encoding with the
845 the memory. Return NULL on encoding or memory allocation error.
848 to the index of the invalid character on encoding error.
878 // Get the current locale encoding name:
899 wchar_t encoding[23];
901 swprintf(encoding, Py_ARRAY_LENGTH(encoding), L"cp%u", ansi_codepage);
902 encoding[Py_ARRAY_LENGTH(encoding) - 1] = 0;
903 return _PyMem_RawWcsdup(encoding);
905 const char *encoding = nl_langinfo(CODESET);
906 if (!encoding || encoding[0] == '\0') {
913 int res = decode_current_locale(encoding, &wstr, NULL,
928 wchar_t *encoding = _Py_GetLocaleEncoding();
929 if (encoding == NULL) {
934 PyObject *str = PyUnicode_FromWideChar(encoding, -1);
935 PyMem_RawFree(encoding);
951 /* 646 refers to ISO/IEC 646 standard that corresponds to ASCII encoding */
1016 and UCS-4 use 4-byte encoding, and one wchar_t symbol always correspond
1235 /* Call _wstat() on Windows, or encode the path to the filesystem encoding and
1593 encoding and use fopen() otherwise.
1634 encoding and call fopen() otherwise.
1912 /* Read value of symbolic link. Encode the path to the locale encoding, decode
1913 the result from the locale encoding.
1915 Return -1 on encoding error, on readlink() error, if the internal buffer is
1962 encoding, decode the result from the locale encoding.
1964 Return NULL on encoding error, realpath() error, decoding error
2322 including the null character. Decode the path from the locale encoding.