-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fmt/strtime: support non-ASCII in
strftime
format strings
I'm not sure why I didn't do this initially. I think I thought there wasn't a use case. But it's easy enough to support. This would have probably been easier if we accepted a `&str` for the format string, especially since we require valid UTF-8 (which is a strict relaxation from requiring valid ASCII). In that case, we would just iterate over `chars()`. But, that would require the caller to create the `&str` (thus paying for UTF-8 validation) and would require `strftime` to do UTF-8 decoding. This way, we don't require any of that up-front UTF-8 validation, and in the vast majority of cases (ASCII-only), we just handle things one-byte-at-a-time without caring about UTF-8. Fixes #155
- Loading branch information
1 parent
9962d03
commit 1ecb1ee
Showing
3 changed files
with
63 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters