Formatting and accents in urls

AI-generated summary

Users are discussing issues with URL formatting and accents in Discourse categories. danilomatos reports that category slugs automatically include accents (e.g., dívidas), causing URLs to display incorrectly and preventing edits. Steven suggests avoiding special characters in slugs and using ASCII alternatives like dividas. Falco recommends changing the slug generation method to encoded to preserve accents, but danilomatos clarifies they don’t want accents and still face the issue. Falco provides steps to fix it: switch to encoded, edit the slug to ASCII, then revert the setting. saquetim shares a similar experience, noting that even with ascii slug generation, an accidental accent in the slug breaks editing, and suggests Discourse should validate slug content based on the setting.

Hello everyone! I’m having trouble formatting the url.

is being generated automatically in questions and adds accents.

ex: https://cashlandia.com.br/c/dívidas/10

in the browser it looks like this: https://cashlandia.com.br/c/dívidas/10

what I try to do is: https://cashlandia.com.br/c/dividas/10

I had trouble understanding the issue, but copy-pasting the direct link helped me get it.

I think it’s not discourse’s fault tho, you should avoid special characters in category slugs

Keep the Dívidas category name, but use dividas as a category slug

Other wise, when the category slug is saved with the accent, it will be changed right away: image

the category is this: https://cashlandia.com.br/c/dívidas/10

however I realized after it was generated, the others I managed to edit, but it gave an error 404 when I was going to edit and this was the only one that doesn’t run out of the accent.

even the questions were being added with accents when I had them. but the questions were normal without touching anything now, I just cleared the cache. this category does not edit, it deletes

Change the site setting slug generation method to encoded if you want special chacacters in your URLs.

exactly that, I do not want and even so it generates with accents.
look how it is, the pattern is what I don’t understand

You will need to:

  1. Change the site setting slug generation method to encoded

  2. Refresh the page

  3. Go and edit the problematic category, change the slug to an ascii one

  4. Head back and revert the site setting change

@Falco,

I’ve had the same problem.

The slug generation method is set to ascii but I accidentally typed the slug with an accent. After that I couldn’t enter the edit page of the category.

In the end I fixed the problem entering the rails console and fixing the slug there.

It’s not totally Discourse fault since that depends on the user typing an accent when there shouldn’t be one. But it would be cool if the system checked if the slug typed has only ASCII characters if the slug generation method is set to ascii.