AlamoEngine-Tools / AlamoEngine-Tools/PetroglyphTools
Binary Model String Encoding
@gruenwaldlk is already working on this.
Since Aug 13, 2023.
- Dominant language
- C#
- Stars
- 8
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Currently .DAT and .MEG are not alligned regarding how to handle strings in their constructors.
I'm not fully decided for either way but i'd like to bring the discussion up anyway.
Scenario: DataModels like KeyTableRecord (DAT) or MegFileNameTableRecord (Meg) require strings to have Single-byte/ASCII encoding. Their constructors allow to pass in a string value.
Discussion: Do we need data sanitazation for the string value, and if yes, at which place should it get applied?
Option 1 (MEG): The string parameter gets "re-encoded" within the constructor. The model also stores the original string value in a separate property.
Option 2 (DAT): The model is unaware of the encoding when holding the string value. This would require any consumer to ensure correct data. Since the binary models should be internal anyway, this is a valid option.
Btw: has this line key.Replace("\0", string.Empty); a specific purpose? strings in .NET are not zero-terminated, right?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.