mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 05:43:11 +00:00
Merge pull request #4421 from krader1961/consistent-unicode
Use \uXXXX consistently for unicode code points
(cherry picked from commit 6b2e84be0e
)
Backporting to 2.7.0 branch just to try and keep changes between master
and this branch as minimal as possible.
This commit is contained in:
parent
ace7903bc3
commit
0d93125664
1 changed files with 9 additions and 8 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <pthread.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -486,14 +487,14 @@ wchar_t *quote_end(const wchar_t *pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void fish_setlocale() {
|
void fish_setlocale() {
|
||||||
// Use the Unicode "ellipsis" symbol if it can be encoded using the current locale.
|
// Use various Unicode symbols if they can be encoded using the current locale, else a simple
|
||||||
ellipsis_char = can_be_encoded(L'\x2026') ? L'\x2026' : L'$';
|
// ASCII char alternative. All of the can_be_encoded() invocations should return the same
|
||||||
|
// true/false value since the code points are in the BMP but we're going to be paranoid. This
|
||||||
// Use the Unicode "return" symbol if it can be encoded using the current locale.
|
// is also technically wrong if we're not in a Unicode locale but we expect (or hope)
|
||||||
omitted_newline_char = can_be_encoded(L'\x23CE') ? L'\x23CE' : L'~';
|
// can_be_encoded() will return false in that case.
|
||||||
|
ellipsis_char = can_be_encoded(L'\u2026') ? L'\u2026' : L'$'; // "horizontal ellipsis"
|
||||||
// solid circle unicode character if it is able, fallback to the hash character
|
omitted_newline_char = can_be_encoded(L'\u23CE') ? L'\u23CE' : L'~'; // "return"
|
||||||
obfuscation_read_char = can_be_encoded(L'\u25cf') ? L'\u25cf' : L'#';
|
obfuscation_read_char = can_be_encoded(L'\u25CF') ? L'\u25CF' : L'#'; // "black circle"
|
||||||
}
|
}
|
||||||
|
|
||||||
long read_blocked(int fd, void *buf, size_t count) {
|
long read_blocked(int fd, void *buf, size_t count) {
|
||||||
|
|
Loading…
Reference in a new issue