search

Home  >  Q&A  >  body text

Unicode character description escape

I'm revisiting a browser plugin I created a while ago that provides conversion to and from various Unicode escape sequences.

However, I have now absentmindedly forgotten, and have been unable to rediscover, that mentions of languages ​​where escape sequences like \C{Latin Small Letter A} are supposed to work (Unicode descriptions) are actually Unicode character replacement, in this case "a").

I believe it is written in PHP, or at least a proposal for PHP, but I don't see any spec supporting this syntax right now.

P粉489081732P粉489081732481 days ago569

reply all(1)I'll reply

  • P粉953231781

    P粉9532317812023-09-11 09:28:00

    PHP can only use code points

    $ php -r 'var_dump("\u{2615}");'
    string(3) "☕"

    Python can

    >>> import unicodedata
    
    >>> print(unicodedata.lookup('Hot Beverage'))
    ☕

    You can use a Python script and call it from PHP

    reply
    0
  • Cancelreply