You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DMTF standard never states what type of characters BIOS stores in its strings. One can infer from the long history of BIOS that these characters are ASCII but even if it did state just ASCII there is still room for interpretation.
BIOS strings are 8 bit characters with a null terminator. The problem is today's modern computer languages prefer to store strings in a way that accommodates world languages. Rust uses UTF-8 for a char. When using the as operator in Rust to convert from a u8 to a char, it uses From. As described in the documentation:
Maps a byte in 0x00..=0xFF to a char whose code point has the same value, in U+0000..=U+00FF.
Unicode is designed such that this effectively decodes bytes with the character encoding that IANA calls ISO-8859-1. This encoding is compatible with ASCII.
This is the best solution I can think of because it will preserve the original byte value for 0-255. In other words, there should always be 1:1 mapping and never a many to one or one to many. Preserving 1:1 mapping means that you can know with certainty what the BIOS string originally looked like.
Unicode's first 256 values (0-255) are identical to ISO-8859-1. In other words, converting a byte 0xNN to 0x00NN is an ISO-8859-1 conversion between single byte to wide. The operation can easily be reversed.
The text was updated successfully, but these errors were encountered:
The DMTF standard never states what type of characters BIOS stores in its strings. One can infer from the long history of BIOS that these characters are ASCII but even if it did state just ASCII there is still room for interpretation.
BIOS strings are 8 bit characters with a null terminator. The problem is today's modern computer languages prefer to store strings in a way that accommodates world languages. Rust uses UTF-8 for a char. When using the
as
operator in Rust to convert from a u8 to a char, it uses From. As described in the documentation:This is the best solution I can think of because it will preserve the original byte value for 0-255. In other words, there should always be 1:1 mapping and never a many to one or one to many. Preserving 1:1 mapping means that you can know with certainty what the BIOS string originally looked like.
Unicode's first 256 values (0-255) are identical to ISO-8859-1. In other words, converting a byte 0xNN to 0x00NN is an ISO-8859-1 conversion between single byte to wide. The operation can easily be reversed.
The text was updated successfully, but these errors were encountered: