We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
io.write_encoded_rune
\x0
Odin: dev-2024-12-nightly:cf53404 OS: Windows 10 Home Basic (version: 22H2), build 19045.5247 CPU: AMD Ryzen 9 5900X 12-Core Processor RAM: 32713 MiB Backend: LLVM 18.1.8
Values 0 to 6, 14 & 15 should be encoded as \x00 to \x06, \x0E & \x0F
\x00
\x06
\x0E
\x0F
write_encoded_rune only writes \x0 as it doesn't write the string returned from strconv.append_bits
write_encoded_rune
strconv.append_bits
Odin/core/io/util.odin
Lines 132 to 138 in 597fba7
Adding fallthrough to case 1 will fix the issue. Don't know if it's worth me making a PR for a small change like this.
fallthrough
case 1
package buggie import "core:io" import "core:fmt" import "core:strings" main :: proc() { sb := strings.builder_make() writer := strings.to_writer(&sb) for i in '\x00'..='\x10' { io.write_encoded_rune(writer, rune(i)) strings.write_bytes(&sb, {' '}) } fmt.println(string(sb.buf[:])) // current -> '\x0' '\x0' '\x0' '\x0' '\x0' '\x0' '\x0' '\a' '\b' '\t' '\n' '\v' '\f' '\r' '\x0' '\x0' '\x10' // expected -> '\x00' '\x01' '\x02' '\x03' '\x04' '\x05' '\x06' '\a' '\b' '\t' '\n' '\v' '\f' '\r' '\x0e' '\x0f' '\x10' }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Context
Expected Behavior
Values 0 to 6, 14 & 15 should be encoded as
\x00
to\x06
,\x0E
&\x0F
Current Behavior
write_encoded_rune
only writes\x0
as it doesn't write the string returned fromstrconv.append_bits
Odin/core/io/util.odin
Lines 132 to 138 in 597fba7
Adding
fallthrough
tocase 1
will fix the issue.Don't know if it's worth me making a PR for a small change like this.Steps to Reproduce
The text was updated successfully, but these errors were encountered: