For an upcoming presentation of the current development progress, the file had to be converted to UTF-8. On Unix-like systems, iconv is a tool that was previously unknown to me and handles exactly this task perfectly.
You can do this with iconv -f old_encoding -t new_encoding sourcefile > targetfile. My source file came from a Windows system, so I assumed it was encoded as Windows-1252. iconv -f Windows-1252 -t UTF-8 demo.json > demoUTF8.json produces a file encoded in UTF-8.
You can display a list of supported encodings with iconv -l. At gnu.org there is a good overview of the parameters and their meaning.
A really helpful tool when you need to convert encodings quickly.
Update: iconv is only available after installing the Xcode tools.
Sebastian Seidel
As a mobile enthusiast and managing director of Cayas Software GmbH, it is very important to me to support my team and our customers in discovering new potential and growing together. Here I mainly write about the development of Android and iOS apps with Xamarin and .NET MAUI.