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
Expect all input characters to be output correctly.
What did you see instead?
In the case of the conditions, when writing with Writer, the byte array is cut off at the halfway point when it exceeds 4096 bytes, and a �(replacement character) is output.
The reason for using a custom writer is to replace strings that cannot be converted during the UTF-8 -> SJIS conversion with another string.
I understand that the byte array passed to Writer() is simply passed as 4096 bytes separated by 4096 bytes.
For the convenience of conversion from UTF-8 to SJIS, if the byte array delimited by 4096 bytes contains characters that cannot be converted, an error will occur there.
The text was updated successfully, but these errors were encountered:
I think your custom writer should keep state so that it properly handles characters spread over multiple writes.
Or you could have implemented it as a transform.Transformer.
encoding/csv assumes that the io.Writer passed to csv.NewWriter honors the io.Writer interface documented at https://pkg.go.dev/io#Writer. Your runeWriter doesn't do that. We aren't going to encoding/csv to support non-compliant Writer implementations, so closing.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am trying to generate CSV output using
encoding/csv
.What did you expect to see?
Expect all input characters to be output correctly.
What did you see instead?
In the case of the conditions, when writing with Writer, the byte array is cut off at the halfway point when it exceeds 4096 bytes, and a �(replacement character) is output.
The reason for using a custom writer is to replace strings that cannot be converted during the UTF-8 -> SJIS conversion with another string.
The example describes the following
In practice, it is used as follows
I understand that the byte array passed to Writer() is simply passed as 4096 bytes separated by 4096 bytes.
For the convenience of conversion from UTF-8 to SJIS, if the byte array delimited by 4096 bytes contains characters that cannot be converted, an error will occur there.
The text was updated successfully, but these errors were encountered: