Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Character Limit With Issue with Urdu Slugs #3514
In English, we're limited to 255 characters in a slug.
With Urdu, it seems to be significantly less and the error message isn't useful
I suspect that this is because Urdu uses more bytes per character than ASCII characters.
Steps to reproduce
A long title
Is 202 characters so should be sluggable, but because it's 354 bytes (https://mothereff.in/byte-counter) it seems to be disallowed.
Shorten that to 230 bytes (to allow a few bytes for dashes)...
And it'll work
There is a validation rule ensuring that slugs and URIs are <= 255 characters so they can fit into their
The validation error message still mentions “characters” because most people who run into this won’t be using multi-byte characters and wouldn’t know how to limit to “255 bytes”, but even if it’s not technically accurate, at least it will point you in the right direction.
Yeah, I understand -- but also understand from close up for years how much such things bite a multilingual environment. German itself is like 150% of English, still using Latin-1 characters.
The actual saving grace is probably the size of the field vs. generally reasonable slugs -- divided by 2 or 4...
Anyway, thanks for thinking, as ever, Brandon. And I'm having to think very carefully myself what complexity to present, in doc after reducing it as much as possible in the application, you know where. It's going to be the focus-group beta that determines in what form or whether this thing sensibly flies.
You and Brad weren't wrong to think of the alternative of consulting it in, though I can't see how that path with open source would get me out of the hot seat of intense support, exactly -- though, just this moment am thinking again...maybe I missed a point, while falling into the gravitation of long perfecting ;)