mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-23 00:01:16 -03:00
Introduce wcs2string_callback
This is like wcs2string, but instead of returning a std::string, it invokes a user-supplied function with each converted character. The idea is to allow interleaved conversion and output.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <locale>
|
||||
|
||||
#include "common.h"
|
||||
#include "flog.h"
|
||||
|
||||
wcstring_range wcstring_tok(wcstring &str, const wcstring &needle, wcstring_range last) {
|
||||
using size_type = wcstring::size_type;
|
||||
@@ -196,3 +197,7 @@ wcstring join_strings(const wcstring_list_t &vals, wchar_t sep) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void wcs2string_bad_char(wchar_t wc) {
|
||||
FLOGF(char_encoding, L"Wide character U+%4X has no narrow representation", wc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user