Sanitizing category names

I have a category called C# on my blog, Hugo generates a categories/c#/index.xml file for it, which works locally but not on Netlify where I host my blog.

Netlify deploy fails with

12:22:30 PM: failed during stage ‘deploying site’: Invalid filename ‘categories/c#/index.xml’. Deployed filenames cannot contain # or ? characters

Is there a way to “sanitize” the category names, making Hugo generate categories/csharp/index.xml instead of categories/c#/index.xml

As far as I understand, this is a limitation of the FTP protocol that hosts use to move files between servers. If you have SFTP access to the server, you can upload files with such names. Another way is to change the name of the tag.

After you change the name of the tag, you can change its display using the replace function in the template that displays this tag.