User-set name strings are not trusted data. Even if you filter on submission, people will find ways around it.
This is the second "User can set the name of a device to a string that screws things up badly" bug in recent history. The other one was the "You can set your AirTag name to cross site scripting tags" one.