Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(159149)

Side by Side Diff: Include/unicodeobject.h

Issue 28128: Improve the warning message for invalid escape sequences
Patch Set: Created 3 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Include/bytesobject.h ('k') | Lib/test/test_string_literals.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef Py_UNICODEOBJECT_H 1 #ifndef Py_UNICODEOBJECT_H
2 #define Py_UNICODEOBJECT_H 2 #define Py_UNICODEOBJECT_H
3 3
4 #include <stdarg.h> 4 #include <stdarg.h>
5 5
6 /* 6 /*
7 7
8 Unicode implementation based on original code by Fredrik Lundh, 8 Unicode implementation based on original code by Fredrik Lundh,
9 modified by Marc-Andre Lemburg (mal@lemburg.com) according to the 9 modified by Marc-Andre Lemburg (mal@lemburg.com) according to the
10 Unicode Integration Proposal. (See 10 Unicode Integration Proposal. (See
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 ); 1478 );
1479 #endif 1479 #endif
1480 1480
1481 /* --- Unicode-Escape Codecs ---------------------------------------------- */ 1481 /* --- Unicode-Escape Codecs ---------------------------------------------- */
1482 1482
1483 PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape( 1483 PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
1484 const char *string, /* Unicode-Escape encoded string */ 1484 const char *string, /* Unicode-Escape encoded string */
1485 Py_ssize_t length, /* size of string */ 1485 Py_ssize_t length, /* size of string */
1486 const char *errors /* error handling */ 1486 const char *errors /* error handling */
1487 ); 1487 );
1488
1489 /* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape
1490 chars. */
1491 PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscape(
1492 const char *string, /* Unicode-Escape encoded string */
1493 Py_ssize_t length, /* size of string */
1494 const char *errors, /* error handling */
1495 const char **first_invalid_escape /* on return, points to first
1496 invalid escaped char in
1497 string. */
1498 );
1488 1499
1489 PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString( 1500 PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
1490 PyObject *unicode /* Unicode object */ 1501 PyObject *unicode /* Unicode object */
1491 ); 1502 );
1492 1503
1493 #ifndef Py_LIMITED_API 1504 #ifndef Py_LIMITED_API
1494 PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape( 1505 PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape(
1495 const Py_UNICODE *data, /* Unicode char buffer */ 1506 const Py_UNICODE *data, /* Unicode char buffer */
1496 Py_ssize_t length /* Number of Py_UNICODE chars to encode */ 1507 Py_ssize_t length /* Number of Py_UNICODE chars to encode */
1497 ); 1508 );
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 2293
2283 /* Fast equality check when the inputs are known to be exact unicode types 2294 /* Fast equality check when the inputs are known to be exact unicode types
2284 and where the hash values are equal (i.e. a very probable match) */ 2295 and where the hash values are equal (i.e. a very probable match) */
2285 PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *); 2296 PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *);
2286 #endif /* !Py_LIMITED_API */ 2297 #endif /* !Py_LIMITED_API */
2287 2298
2288 #ifdef __cplusplus 2299 #ifdef __cplusplus
2289 } 2300 }
2290 #endif 2301 #endif
2291 #endif /* !Py_UNICODEOBJECT_H */ 2302 #endif /* !Py_UNICODEOBJECT_H */
OLDNEW
« no previous file with comments | « Include/bytesobject.h ('k') | Lib/test/test_string_literals.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+