Empty spaces and accents in tags urls

Hello!

I’ve got a problem in my server with a kirby 2 installation. I’ve got tags with empty spaces and accents (spanish language). I’ve used the code in this post (Tags without spaces and critical characters) and it works perfect for empty spaces but keep the accents, and the server doesn’t work well with accents when you visit the page of the tag, it gives an error caused by html encoding. Is there any way to clean accents from the tag urls?

http://websiteurl/noticias/tag:Torres+de+refrigeración -> this works in local but not in server
http://websiteurl/noticias/tag:Torres+de+refrigeracion -> This is the one i need working but it returns 0 post with that tag even when they exist.

Thank you!

Could be an UTF-8 issue, if you check phpinfo(), what character encoding do you have?

Also, have you set the locale in your config?

I have default_charset UTF-8 and the locale in the config as follow:

c::set(‘languages’, [
[
‘code’ => ‘es’,
‘name’ => ‘Español’,
‘default’ => true,
‘locale’ => ‘es_ES’,
‘url’ => ‘/’,
]
]);

It’s very weird the error actually :confused:

And if you set the locale to es_ES.utf-8 or whatever exact locale is actually installed on the server. Check with locale -a | grep es in a shell.

And have you checked with phpinfo() what the default charset is?

Hello Texnixe!

I’m just waiting for the admin of the server tell me something about the locale -a | grep es in a shell.

I’ll let you know when i’ve updates.

Thanks for your help and have a nice weekend!