Is there an elegant, cross-platform, way to determine the latest Unicode version that a machine supports?

  • Tobias Hunger
    link
    fedilink
    English
    41 year ago

    What do you mean by “system support”? The system is mostly pushing bytes along, the programming languages/UI ovaries tend to do all the hard work. So it is usually more interesting to see what those support.

    • @mronOP
      link
      English
      3
      edit-2
      1 year ago

      Emoji support is probably the best way to demonstrate what I mean:

      A simple example: if this (🐦‍⬛) renders as an image of a blackbird, your system supports Unicode 15.0.

      A more complex example: if this (🧑‍⚖️) appears as a judge, your system supports Unicode 12.1, if it appears as a Person followed by Scales your system supports Unicode 10.0, and if you can only see the Scales, your system supports Unicode 4.1.

      The downstream use case would be to avoid attempting to output specific characters for a user that wouldn’t see them correctly (i.e. if I want to output a blackbird, I want them to see it, or if I output a judge I don’t want them to see scales).

    • @mronOP
      link
      English
      11 year ago

      I’m flexible tbh, but my initial checks with a Python approach led me to unicodedata.unidata_version, which is correct for Python support but not system support.

  • @[email protected]
    link
    fedilink
    English
    21 year ago

    Is this “support” in the sense of “can this sequence of code points be rendered correctly to the screen”?

    OS and font dependent.

  • @colonial
    link
    English
    1
    edit-2
    1 year ago

    I don’t know of any existing library, but I think it should be relatively easy to wrap existing APIs for all the major operating systems (locale on Linux, some PowerShell voodoo on Windows…) behind a single call, and just use runtime checks/conditional compilation to use the right one behind the scenes.

    Edit: wait, I confused Unicode version for encoding type (8/16/32). Sorry, that’s my bad.