String encodings are currently technically unspecified
Currently, the EVF spec doesn't actually specify whether or not the c strings in the header need to be valid utf-8 (at least not in the english translation).
It does state that utf-8 is recommended in the design goals, but the actual specification only mentions them as strings. Even if we take the design goals to be part of the spec, a recommendation doesn't mean that clone authors can't simply decide to not follow it.
Also, there is no place in the file format that specifies the encoding used.
So, in its current state, EVF strings aren't actually well specified. Sure, we can just parse them as utf-8, but it would be possible to create a compliant clone that writes some other encoding.
Proposal: specify that strings are utf-8 (or add encoding info to the format)
I would propose one of the following two changes to the standard:
- Specify that all c strings are utf-8. Then, if a clone writes strings in a different encoding, it is non-compliant, and replays it produces should be rejected by other clones/replay viewers.
- Add a way to specify the encoding in the format.
I prefer the first option, as I don't think it's actually very limiting:
- Requiring a new clone, a program with an international audience, to use a unicode format in the year 2024 is not too much to ask.
- The strings are c strings, eliminating multi-byte encodings where characters can contain
'\0'. As much as these might be appealing to windows developers, they're already not an option.
- So, as industry standards go, we're pretty much left with utf-8 anyway.
- Even if utf-8 is too much of an ask for a given application, ASCII definitely isn't, and valid ASCII is valid utf-8.
What about translating old replays?
The one drawback to making utf-8 part of the spec instead of a recommendation is that it can complicate translating replays from other clones that use code pages. However, this seems like a kinda niche application to me - also, since vsweep 4.0.0, all strings in RMVs are utf-8, and in Arbiter, some inference via the player's country could probably be done to produce pretty good results.
That leaves old RMV replays, but tools that take an extra input for the encoding are still a feasible fallback to process these - especially as no new data should be generated in that format in any place where it gets submitted to an automated service that needs to make a decision without human intervention.
Also, in general, only supporting utf-8 doesn't make EVF less universal - it's not like code pages can't be mapped to utf-8, it's just that requiring utf-8 would make that necessary at the time a replay is converted.
So, altogether, I'd argue that the burden of dealing with multiple possibilities for encodings should not be dragged on to the next generation of replay processors.
String encodings are currently technically unspecified
Currently, the EVF spec doesn't actually specify whether or not the c strings in the header need to be valid utf-8 (at least not in the english translation).
It does state that utf-8 is recommended in the design goals, but the actual specification only mentions them as strings. Even if we take the design goals to be part of the spec, a recommendation doesn't mean that clone authors can't simply decide to not follow it.
Also, there is no place in the file format that specifies the encoding used.
So, in its current state, EVF strings aren't actually well specified. Sure, we can just parse them as utf-8, but it would be possible to create a compliant clone that writes some other encoding.
Proposal: specify that strings are utf-8 (or add encoding info to the format)
I would propose one of the following two changes to the standard:
I prefer the first option, as I don't think it's actually very limiting:
'\0'. As much as these might be appealing to windows developers, they're already not an option.What about translating old replays?
The one drawback to making utf-8 part of the spec instead of a recommendation is that it can complicate translating replays from other clones that use code pages. However, this seems like a kinda niche application to me - also, since vsweep 4.0.0, all strings in RMVs are utf-8, and in Arbiter, some inference via the player's country could probably be done to produce pretty good results.
That leaves old RMV replays, but tools that take an extra input for the encoding are still a feasible fallback to process these - especially as no new data should be generated in that format in any place where it gets submitted to an automated service that needs to make a decision without human intervention.
Also, in general, only supporting utf-8 doesn't make EVF less universal - it's not like code pages can't be mapped to utf-8, it's just that requiring utf-8 would make that necessary at the time a replay is converted.
So, altogether, I'd argue that the burden of dealing with multiple possibilities for encodings should not be dragged on to the next generation of replay processors.