nushell/crates/nu-command/src
Antoine Stevan 01d8961eb7
use to_lowercase in str downcase (#10850)
# Description
as we can see in the [documentation of
`str.to_lowercase`](https://doc.rust-lang.org/std/primitive.str.html#method.to_lowercase),
not only ASCII symbols have lower and upper variants.

- `str upcase` uses the correct method to convert the string

7ac5a01e2f/crates/nu-command/src/strings/str_/case/upcase.rs (L93)
- `str downcase` incorrectly converts only ASCII characters

7ac5a01e2f/crates/nu-command/src/strings/str_/case/downcase.rs (L124)

this PR uses `str.to_lower_case` instead of `str.to_ascii_lowercase` in
`str downcase`.

# User-Facing Changes
- upcase still works fine
```nushell
~ l> "ὀδυσσεύς" | str upcase
ὈΔΥΣΣΕΎΣ
```
- downcase now works

👉 before
```nushell
~ l> "ὈΔΥΣΣΕΎΣ" | str downcase
ὈΔΥΣΣΕΎΣ
```
👉 after
```nushell
~ l> "ὈΔΥΣΣΕΎΣ" | str downcase
ὀδυσσεύς
```

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
-  `toolkit test`
-  `toolkit test stdlib`

adds two tests
- `non_ascii_upcase`
- `non_ascii_downcase`

# After Submitting
2023-10-27 19:16:17 +02:00
..
bytes Add long options for bits and bytes (#10601) 2023-10-05 18:45:28 +02:00
charting Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
conversions remove into decimal (#10341) 2023-10-10 20:05:44 +02:00
database Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
date fix clippy (#10659) 2023-10-10 03:31:15 +13:00
debug Make debug info lazy (#10728) 2023-10-24 12:48:05 -05:00
env Fix editor config for reedline and config nu/env (#10535) 2023-09-29 16:36:03 +02:00
experimental Add functions for each Value case (#9736) 2023-07-21 08:20:33 -05:00
filesystem deprecate glob --not in favor of glob --exclude (#10827) 2023-10-25 17:11:57 +02:00
filters Finish removing profile command and related data (#10807) 2023-10-22 14:06:53 +03:00
formats fix: Ensure consistent vals and cols when parsing with --flexible (#10814) 2023-10-24 15:54:26 -05:00
generators add unfold back with a deprecation warning (#10771) 2023-10-19 19:23:06 +02:00
hash Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
help Add 'help escapes' command for quick reference of nushell string escapes (#10522) 2023-09-30 09:04:27 -05:00
math Add long options for generators and math (#10752) 2023-10-19 18:17:42 +02:00
misc Add long options for misc and network (#10753) 2023-10-19 18:16:44 +02:00
network Add long options for misc and network (#10753) 2023-10-19 18:16:44 +02:00
path Add long options for path (#10775) 2023-10-19 22:07:01 +02:00
platform implement whoami using uutils (#10488) 2023-10-25 09:53:52 -05:00
random Add long options for platform and random (#10776) 2023-10-19 22:04:33 +02:00
removed Rename misused "deprecation" to removal (#10000) 2023-08-15 07:17:31 +12:00
shells Fix usage for the exit command. (#9450) 2023-06-16 10:09:02 +02:00
strings use to_lowercase in str downcase (#10850) 2023-10-27 19:16:17 +02:00
system Improve registry value return types (#10806) 2023-10-23 07:21:27 -05:00
viewers Finish removing profile command and related data (#10807) 2023-10-22 14:06:53 +03:00
default_context.rs implement whoami using uutils (#10488) 2023-10-25 09:53:52 -05:00
example_test.rs feat: Add unfold command (#10489) 2023-09-30 09:08:06 -05:00
lib.rs Move eval_hook to nu-cmd-base (#10146) 2023-08-29 23:46:50 +02:00
progress_bar.rs cp progress bar implementation (#8012) 2023-02-22 11:57:38 -08:00
sort_utils.rs Use slices directly instead of &Vec (#10328) 2023-09-12 11:38:20 +08:00