MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4450
Loc: Melbourne, Australia
Send PM
Re: ROMCMP - Can anyone confirm if it is UTF-8 Unicode compliant?
01/13/20 03:47 AM


MAME has all kinds of issues with UTF-8 command line arguments and console I/O on Windows while it works most of the time on Linux/Mac. There doesn't seem to be an actually good way to solve it though.

Right now, MAME blindly outputs UTF-8 via cout/cerr. This works most of the time on Linux/Mac because almost everyone uses UTF-8 locales these days. It doesn't work on Windows, because Windows console subsystem will try to interpret it as the current ANSI code page, which typically depends on the display language.

Bletch (npwoods) attempted to solve it in imgtool by switching the entire thing to use wchar_t I/O streams. The net result is that it still works fine on Linux/Mac, but is broken in a different way on Windows. You now end up with interspersed NUL characters in the output. It could be an issue in the MinGW runtime itself causing this, but it's not really relevant - the fact is it doesn't work.

The other thing complicating it is -listxml which needs to be able to produce a UTF-8 XML file. For this to work on Windows in a command shell, the current hack of spitting out UTF-8 via cout is the only approach that works. However it seems to break if you try to do it from PowerShell.

tl;dr console I/O is pretty much fucked on Windows, and attempts to fix it have failed







Entire thread
Subject Posted by Posted on
* ROMCMP - Can anyone confirm if it is UTF-8 Unicode compliant? Pr3tty F1y 01/12/20 03:55 PM
. * Re: ROMCMP - Can anyone confirm if it is UTF-8 Unicode compliant? Vas Crabb  01/13/20 03:47 AM
. * Re: ROMCMP - Can anyone confirm if it is UTF-8 Unicode compliant? Pr3tty F1y  01/13/20 11:35 PM
. * Issue with zip parser? Pr3tty F1y  01/12/20 07:28 PM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 34 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 294