-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Sorry to spam, but this makes me think a lot :-)
I have some proposal with the way encoding is handled with the C syntax.
struct person
{
char name[50];
char single_char;
};
- a single char should be decoded like an array. I think it is not the case right now.
- i think there is no real need to support
signed char/unsigned char. As i saw in the documentationParse source code files, it's probably not a very good C programing style to specify the sign of a char. For that there is thebytetype. which is an int8. I thinkcharshould only be used for characters.
I also saw that the library uses utf-8 as default. It is probably not a good idea. Such thing could be be latin1, or a lot of other stuffs. It's also possible that encoding stay unknown until the structure is read.
Thinking about that, and following the way packing is handled, maybe this could be generalized for encoding, like using an own pragma.
So what it could be switched in the middle of the description if it is needed.
#pragma encoding("utf-8")
struct person
{
char name[50];
#pragma encoding("raw")
char single_char;
};
This said, i don't have such problems for now.
So it's just proposals.
Metadata
Metadata
Assignees
Labels
No labels