Fix private-use units to avoid validity constraints

Description

This is to fix a regression introduced by


I just realized that private-use units (pu_single_unit) in the draft 46.1 references ‘single_unit’, which has have validity constraints in v46.1. That negates the whole purpose. Something like xxx-meter is valid, but xxx-smoot is not (it doesn’t match any existing unit). Moreover, they cannot have multiple parts, so the example given of xxx-square-knuts is illegal on two counts (square-xxx-knuts would be ok).

To fix this, we should change the pu_single_unit to the following:

pu_single_unit
:= ("xxx-" | "x-") [a-z0-9]{3,8}

  • Examples:

    • square-xxx-knuts (a Harry Potter unit)

  • Notes:

    • "x-" is only for backwards compatibility; it is deprecated and should not be generated

    • See Private-Use Units

Background

Here is the current status in the draft v46.1, where single_unit ends up referencing base_component (where the validity constraint is — I bolded that)

pu_single_unit
:= "xxx-" single_unit
   | "x-" single_unit

  • Examples:

    • xxx-square-knuts (a Harry Potter unit)

  • Notes:

    • "x-" is only for backwards compatibility; it is deprecated and should not be generated

    • See Private-Use Units

base_component
:= [a-z]{3,}

  • [ wfc: must not have a prefix as an initial segment. ]

  • [ wfc: must not be a value in <unitIdComponent type="X"> for X in {prefix, suffix, power, and, per} ]

  • [ vc: Must be an attribute value of the source in: <convertUnit source='…' …> or the type in <unitAlias type="…" replacement="…" …> ]

relates to

Activity

Show:

Peter Edberg December 8, 2024 at 6:48 PM

Fix cherry-picked to maint/maint-46 branch 2024-12-08

Mark Davis December 8, 2024 at 5:06 AM

Yes, thanks!

Peter Edberg December 8, 2024 at 3:28 AM

And I am taking the liberty of moving this to Done with Steven (who approved the PR) as reviewer, to clean up ticket status before the cherry-pick to main branch. Hope that is OK.

Mark Davis December 6, 2024 at 5:05 AM

I’m taking the liberty of accepting this subtask, which is to fix a regression introduced by CLDR-15948: Clarify the well-formedness and validity of certain Unicode CLDR identifiers for MF2.

Fixed

Details

Priority

Assignee

Reporter

Reviewer

Fix versions

Components

Created December 3, 2024 at 4:29 AM
Updated March 11, 2025 at 3:05 PM
Resolved December 8, 2024 at 3:28 AM