-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
Description
The encoder and decoder currently support multi-byte characters, but it requires library users to enable the feature explicitly. This behavior is unintuitive and leads to confusion (see #52).
decoder := fixedwidth.NewDecoder(strings.NewReader(data))
decoder.SetUseCodepointIndices(true)
// Decode as usual now
buff := new(bytes.Buffer)
encoder := fixedwidth.NewEncoder(buff)
encoder.SetUseCodepointIndices(true)
// Encode as usual now
There is still a performance cost associated with supporting multi-byte characters, so I'd like to keep the feature in the library.
Mutlti-byte character support should be enabled by default, but there should still be an option to opt-out.
This is a breaking change and should be released as part of a major version bump.
Reactions are currently unavailable