0

In a Python console, I obtain as expected:

>>> chr(0x10ffff)
'\U0010ffff'
>>> chr(0x110000)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: chr() arg not in range(0x110000)

In this table which provides all the unicodes, the maximal used value (not reserved) is 0xE01EF, and with reserved ones 0x10FFFF. This question explains reasons why the maximal value is 0x10FFFF, but in order to design a code that can adapt to unicode standard evolution, how can I get this maximal value? Is there an existing module that provides it?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
lalebarde
  • 1,684
  • 1
  • 21
  • 36
  • 1
    I think you will find your answer here: https://stackoverflow.com/q/52203351 – Corralien Jan 30 '22 at 11:58
  • `the maximal usable value (not reserved) is 0xE01EF` this is simply wrong. Those are the *assigned* code points, and more will be assigned later – phuclv Jan 30 '22 at 15:36
  • F0000—FFFFF Supplementary Private Use Area-A, 100000—10FFFF Supplementary Private Use Area-B – lalebarde Jan 30 '22 at 18:59
  • 1
    @Corralien, I have put this information in my question already. My question is how to get this maximum value in Python, something like `get_last_unicode_val()`. So in my opinion, it is not a duplicate. – lalebarde Jan 30 '22 at 19:04
  • I reopened the question. Maybe @phuclv can answer to your question. – Corralien Jan 30 '22 at 19:24
  • 2
    yep, [this one](https://stackoverflow.com/questions/34813535/is-it-possible-to-know-the-maximum-number-accepted-by-chr-using-python) does, and my question is a duplicate of it. Nice catch, thanks @Corralien – lalebarde Jan 30 '22 at 19:29

0 Answers0