Victor Stinner
cfed46e00a
PyUnicode_FromKindAndData() fails with a ValueError if size < 0
15 years ago
Victor Stinner
42885206ec
UTF-8 decoder: set consumed value in the latin1 fast-path
15 years ago
Victor Stinner
d3df8ab377
Replace _PyUnicode_READY_REPLACE() and _PyUnicode_ReadyReplace() with unicode_ready()
* unicode_ready() has a simpler API
* try to reuse unicode_empty and latin1_char singleton everywhere
* Fix a reference leak in _PyUnicode_TranslateCharmap()
* PyUnicode_InternInPlace() doesn't try to get a singleton anymore, to avoid
having to handle a failure
15 years ago
Victor Stinner
f01245067a
Rewrite PyUnicode_TransformDecimalToASCII() to use the new Unicode API
15 years ago
Victor Stinner
2d718f39a5
Remove an unused variable from PyUnicode_Copy()
15 years ago
Victor Stinner
87af4f2f3a
Simplify PyUnicode_Copy()
USe PyUnicode_Copy() in fixup()
15 years ago
Victor Stinner
5bbe5e7c85
Fix a compiler warning in _PyUnicode_CheckConsistency()
15 years ago
Victor Stinner
42bf77537e
Rewrite PyUnicode_EncodeDecimal() to use the new Unicode API
Add tests for PyUnicode_EncodeDecimal() and
PyUnicode_TransformDecimalToASCII().
15 years ago
Antoine Pitrou
0a3229de6b
Issue #13417 : speed up utf-8 decoding by around 2x for the non-fully-ASCII case.
This almost catches up with pre-PEP 393 performance, when decoding needed
only one pass.
15 years ago
Victor Stinner
da29cc36aa
Issue #13441 : _PyUnicode_CheckConsistency() dumps the string if the maximum
character is bigger than U+10FFFF and locale.localeconv() dumps the string
before decoding it.
Temporary hack to debug the issue #13441 .
15 years ago
Victor Stinner
9e30aa52fd
Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()
And PyUnicode_GetSize() => PyUnicode_GetLength()
15 years ago
Victor Stinner
4ead7c7be8
PyObject_Str() ensures that the result string is ready
and check the string consistency.
_PyUnicode_CheckConsistency() doesn't check the hash anymore. It should be
possible to call this function even if hash(str) was already called.
15 years ago
Victor Stinner
b960b34577
PyUnicode_AsUTF32String() calls directly _PyUnicode_EncodeUTF32(),
instead of calling the deprecated PyUnicode_EncodeUTF32() function
15 years ago
Victor Stinner
77faf69ca1
_PyUnicode_CheckConsistency() also checks maxchar maximum value,
not only its minimum value
15 years ago
Victor Stinner
d5c4022d2a
Remove the two ugly and unused WRITE_ASCII_OR_WSTR and WRITE_WSTR macros
15 years ago
Victor Stinner
2e9cfadd7c
Reuse surrogate macros in UTF-16 decoder
15 years ago
Victor Stinner
ae4f7c8e59
charmap_encoding_error() uses the new Unicode API
15 years ago
Victor Stinner
ac931b1e5b
Use PyUnicode_EncodeCodePage() instead of PyUnicode_EncodeMBCS() with
PyUnicode_AsUnicodeAndSize()
15 years ago
Victor Stinner
22168998f5
charmap encoders uses Py_UCS4, not Py_UNICODE
15 years ago
Victor Stinner
1f7951711c
Catch PyUnicode_AS_UNICODE() errors
15 years ago
Ezio Melotti
11060a4a48
#13406 : silence deprecation warnings in test_codecs.
15 years ago
Antoine Pitrou
5418ee0b9a
Issue #13333 : The UTF-7 decoder now accepts lone surrogates
(the encoder already accepts them).
15 years ago
Antoine Pitrou
31b92a534f
Sanitize reference management in the utf-8 encoder
15 years ago
Antoine Pitrou
0290c7a811
Fix regression on 2-byte wchar_t systems (Windows)
15 years ago
Antoine Pitrou
44c6affc79
Avoid crashing because of an unaligned word access
15 years ago
Antoine Pitrou
de20b0b50e
Issue #13149 : Speed up append-only StringIO objects.
This is very similar to the "lazy strings" idea.
15 years ago
Victor Stinner
9f4b1e9c50
Fix and deprecated the unicode_internal codec
unicode_internal codec uses Py_UNICODE instead of the real internal
representation (PEP 393: Py_UCS1, Py_UCS2 or Py_UCS4) for backward
compatibility.
15 years ago
Victor Stinner
24729f36bf
Prefer Py_UCS4 or wchar_t over Py_UNICODE
15 years ago
Victor Stinner
ebf3ba808e
PyUnicode_DecodeCharmap() uses the new Unicode API
15 years ago
Victor Stinner
a98b28c1bf
Avoid PyUnicode_AS_UNICODE in the UTF-8 encoder
15 years ago
Victor Stinner
3326cb6a36
Fix "unicode_escape" encoder
15 years ago
Victor Stinner
0e36826a04
Fix UTF-7 encoder on Windows
15 years ago
Martin v. Löwis
1db7c13be1
Port encoders from Py_UNICODE API to unicode object API.
15 years ago
Victor Stinner
62aa4d086a
Strip trailing spaces
15 years ago
Victor Stinner
0a045efb49
Fix a compiler warning: use unsiged for maxchar in unicode_widen()
15 years ago
Victor Stinner
596a6c4ffc
Fix the code page decoder
* unicode_decode_call_errorhandler() now supports the PyUnicode_WCHAR_KIND
kind
* unicode_decode_call_errorhandler() calls copy_characters() instead of
PyUnicode_CopyCharacters()
15 years ago
Antoine Pitrou
a8f63c02ef
Fix missing goto
15 years ago
Martin v. Löwis
d10759f6ed
Make _PyUnicode_FromId return borrowed references.
http://mail.python.org/pipermail/python-dev/2011-November/114347.html
15 years ago
Martin v. Löwis
e9b11c1cd8
Change decoders to use Unicode API instead of Py_UNICODE.
15 years ago
Victor Stinner
e30c0a1014
Fix gdb/libpython.py for not ready Unicode strings
_PyUnicode_CheckConsistency() checks also hash and length value for not ready
Unicode strings.
15 years ago
Victor Stinner
2fc507fe45
Replace tabs by spaces
15 years ago
Martin v. Löwis
12be46ca84
Drop Py_UNICODE based encode exceptions.
15 years ago
Martin v. Löwis
3d325191bf
Port code page codec to Unicode API.
15 years ago
Victor Stinner
fcd9653667
Fix a compiler warning in unicode_encode_ucs1()
15 years ago
Victor Stinner
fc026c98d8
Fix PyUnicode_EncodeCharmap()
15 years ago
Victor Stinner
7931d9a951
Replace PyUnicodeObject type by PyObject
* _PyUnicode_CheckConsistency() now takes a PyObject* instead of void*
* Remove now useless casts to PyObject*
15 years ago
Victor Stinner
76a31a6bff
Cleanup decode_code_page_stateful() and encode_code_page()
* Fix decode_code_page_errors() result
* Inline decode_code_page() and encode_code_page_chunk()
* Replace the PyUnicodeObject type by PyObject
15 years ago
Victor Stinner
7581cef699
Adapt the code page encoder to the new unicode_encode_call_errorhandler()
The code is not correct, but at least it doesn't crash anymore.
15 years ago
Brian Curtin
2787ea41fd
Fix a compile error (apparently Windows only) introduced in 295fdfd4f422
15 years ago
Martin v. Löwis
23e275b3ad
Port UCS1 and charmap codecs to new API.
15 years ago