The online racing simulator
LFSWorld character encoding problem.
(2 posts, started , go to first unread)
LFSWorld character encoding problem.
I have recently noticed that some driver's names look wrong. All of them have one in common, special characters in their names.
This is the most annoying because you cannot just click their names and see their profile.

Let's take this race: ... son93&raceId=21243896 and racer Lönni. Currently his nick looks like L�nni.
If I click on his name and try watching his profile I see L%uFFFDnni was not found - URL
If I put his correct nick profile shows fine.önni

Used Firefox (61.0.1) and Chrome (67.0.3396.99) and it's the same on both browsers.
Attached images
#2 - Racon
I have the same issue with those characters borking the ajax on, I can't get them through the JSON encoding. I'm currently just stripping them out whilst I wait for time/ideas to fix it, so that at least those names don't take out the whole of the laptimes...


Just came across this while looking for something else and remembered this thread...

I started with just the second line of code, but it makes invalid JSON for some usernames. I thought the ignore parameter was supposed to do exactly what the first line does, but the first line fixes it so Shrug

$name = preg_replace('~[^(\x20-\x7F)]*~', '', $name);
$name = iconv('UTF-8', 'UTF-8//IGNORE', $name);

LFSWorld character encoding problem.
(2 posts, started )