dart-lang / dart-lang/native

Add config to specify encoding for Macro Strings

Open
#416 0 comments 0 reactions 0 assignees View on GitHub
package:ffigen type-enhancement
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

Macro Strings are considered as Utf8 by default, but we have no way to know the encoding used.
E.g the Linux POSIX API uses Extended ASCII in their macro strings.
We should add a config to let the user specify the encoding to use.

Perhaps something like this -
```yaml
macros:
...
encoding:
- 'TXIP_.*': ascii # options
```

We should support these options at very least - `ascii`, `utf8`(default).

Another config option could be `raw` which generates a `Uint8List` instead of a String.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.