nushell/crates/nu-command/src/strings
Rodrigo Friães e211e96d33
Fix nushell#10591: encode returns error with utf-16le and utf-16be encodings (nushell#10591) (#12411)
# Description

This closes (nushell#10591)

The Command encode's help text says that utf-16le and utf-16be encodings
are not supported, however you could still use these encodings and they
didn't work properly, since they returned the bytes UTF-8 encoded:
```bash
"䆺ש" | encode utf-16
Length: 5 (0x5) bytes | printable whitespace ascii_other non_ascii
00000000: e4 86 ba d7 a9 ×××××
 ```
# User-Facing Changes

The Command encode's help text was updated and now when trying to encode with utf-16le and utf-16be returns an error:
![screenshot](https://github.com/nushell/nushell/assets/119532691/c346dc57-8b42-4dfc-93d5-638b0041d89f)

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
2024-04-06 09:07:55 -05:00
..
encode_decode Fix nushell#10591: encode returns error with utf-16le and utf-16be encodings (nushell#10591) (#12411) 2024-04-06 09:07:55 -05:00
format Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
split Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
str_ Range refactor (#12405) 2024-04-06 09:04:56 -05:00
char_.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
detect_columns.rs detect columns: intruduce a --guess flag, remove --legacy (#12333) 2024-03-29 19:59:57 -05:00
guess_width.rs Change default algorithm in detect columns (#12277) 2024-03-26 13:57:55 +08:00
mod.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
parse.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00