-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Character Limit With Issue with Urdu Slugs #3514
Comments
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. |
Take that back. Looking into this further, I was wrong and a So not totally sure if there’s a good course of action here for us to take. Reopening… |
One thing you can do is limit the length of the slug in your section’s URI Format. For example:
|
There was already code in place to auto-shrink slugs in order to get the URI down to <= 255 characters, but there were some logic bugs in the code. Fixed now for the next release. |
Wow, that is a hot one, Brandon. I don't find any doc for this; should there be?? Was watching this one due to experience with languages needing longer sizes...not jumping in though... |
Seems a little too in the weeds to warrant documentation, especially since generally Craft will just do the right thing going forward. |
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 ;) |
Description
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
More detail...
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
Additional info
The text was updated successfully, but these errors were encountered: