Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!

Swap special characters for base versions

Avatar

Level 6

Hi,

I'm looking for a way in Fusion to swap the special characters in a string (e.g. Cédric Genzić) for the base versions (= Cedric Genzic). Any ideas?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Employee

Hmm. very interesting. I don't run into this often but believe the ascii() function will do the trick.

Example: {{ascii("Cédric Genzić"; true)}}

returns: Cedric Genzic

Hope this helps!

Avatar

Level 6

@Andy Hess‚ thanks for the tip!

I'll run all our special names through it to see if there are any exceptions. One that I did already find is Łukasz

Avatar

Employee

The default action is to simply strip the character that it can not map. and you will certainly find exceptions. The code page list is pretty exhaustive and the ascii conversion module must have a unicode char>ascii conversion built in. Looks like this Polish/Cyrillic character is not in the mapping. You can do some replace functions to hard map the exceptions ahead of the ascii() module to move them over but that may not be optimal as it can be a large replace list.

Why not carry over the actual unicode text?

Avatar

Level 6

I'll add the replace functions for characters that are not included. This function creates a username in another system. That username must be based on firstname.lastname and doesn't support unicode characters. But the ascii() function already takes care of 99% of the issues that we had here :-)