#30481: Document that force_str() allows lone surrogates.
--------------------------------------+------------------------------------
Reporter: Adam Hooper | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 2.2
Severity: Normal | Resolution:
Keywords: force_text unicode | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Baptiste Mispelon):
I think the original issue came up because of the confusing usage of the
word "text" in `force_text()`
Django used "text" in opposition to "bytes" but the reporter understood
"text" in the context of Unicode which has a slightly different meaning.
The original report said:
[...] Python allows me to create _non-text_ str objects
So I think the renaming of `force_text` to `force_str` fixed this issue by
removing the association with the concept of "text".
As things are now, `force_str` has the same limitations as python's `str`
when it comes to Unicode issues like lone surrogates so I don't believe we
need to document them.
--
Ticket URL: <https://code.djangoproject.com/ticket/30481#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.ca3329bcfefe78dfe085ef235b38aafe%40djangoproject.com.