Skip to content

Conversation

@robertbastian
Copy link
Member

CLDR-19157

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

@jira-pull-request-webhook

This comment was marked as spam.

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • tools/cldr-code/src/test/java/org/unicode/cldr/util/TestSupplementalDataInfo.java is now changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook

This comment was marked as spam.

@jira-pull-request-webhook

This comment was marked as spam.

@jira-pull-request-webhook

This comment was marked as spam.

@robertbastian robertbastian requested review from macchiati and srl295 and removed request for macchiati January 14, 2026 17:47
@jira-pull-request-webhook

This comment was marked as spam.

@jira-pull-request-webhook

This comment was marked as spam.

Copy link
Member

@macchiati macchiati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a change to the spec that limits the length to 8 (for 48 and beyond)

  • I think you said that 48 got rid of the ones that were longer, if different then adjust.

@robertbastian
Copy link
Member Author

what exactly do you mean?

final CalendarData c = cal.get(calType);
for (final Integer n : c) {
if (c.get(n).getCode() != null) {
assertTrue(c.get(n).getCode().length() <= 8);
Copy link
Member

@srl295 srl295 Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

                            assertTrue(c.get(n).getCode().length() <= 8);
      
      
        
                            final String code = c.get(n).getCode();
      
      
        
                            assertTrue(code.length() <= 8, () -> "code " + code + " > 8");

otherwise it will show "assertion failed: false", but with this it will fail with "long era code: abcdefghij > 8"

Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, with a suggestion for a better err message

Each `era` element has a `code` attribute and optional `aliases` attributes that define invariant strings for identifying the eras. These are more mnemonic than the `type` identifiers (see below).
The `code` is unique within the calendar, and the `aliases` are space-separated identifiers, each also unique within the calendar.
Each `era` element has a `code` attribute and optional `aliases` attributes that define stable strings for identifying the eras. These are more mnemonic than the `type` identifiers (see below).
The `code` defines the primary identifier for the era, and `aliases` are space-separated additional identifiers. All identifiers are valid BCP-47 subtags, i.e. 2-8 ASCII alphanumeric characters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This says that each subtag is 2-8 characters. There_ is no statement that the total length of the code (including all subtags + separators) is limited to 8 characters, as per:

Agreed in Design WG that additional limit of 8 characters can be added to the spec, with a unit test for all versions ≥ 48.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says that each identifier is a BCP-47 subtag. It also says that the code is a single identifier.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a limit of 8 characters on the code attribute.

@macchiati
Copy link
Member

macchiati commented Jan 15, 2026 via email

@robertbastian
Copy link
Member Author

Then we need to discuss this again because that's what I understood.

Each `era` element has a `code` attribute and optional `aliases` attributes that define invariant strings for identifying the eras. These are more mnemonic than the `type` identifiers (see below).
The `code` is unique within the calendar, and the `aliases` are space-separated identifiers, each also unique within the calendar.
Each `era` element has a `code` attribute and optional `aliases` attributes that define stable strings for identifying the eras. These are more mnemonic than the `type` identifiers (see below).
The `code` defines the primary identifier for the era, and `aliases` are space-separated additional identifiers. All identifiers are valid BCP-47 subtags, i.e. 2-8 ASCII alphanumeric characters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a limit of 8 characters on the code attribute.

@macchiati
Copy link
Member

That is, it would be possible to have code='abc-xyz', but not code='abcd-wxyz' (since the latter would exceed 8 ASCII characters).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants