From 2160d037943ef0a3adbf4c6e30a91ee0f205c3f3 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Fri, 2 Sep 2022 14:04:22 +0200 Subject: xC: slightly clean up character encodings --- xC.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xC.c b/xC.c index e5ce465..c80499c 100644 --- a/xC.c +++ b/xC.c @@ -4234,6 +4234,7 @@ buffer_get_log_path (struct buffer *buffer) (void) mkdir_with_parents (path.str, NULL); str_append_c (&path, '/'); + // FIXME: This mixes up character encodings. make_log_filename (buffer->name, &path); str_append (&path, ".log"); return str_steal (&path); @@ -4255,7 +4256,7 @@ buffer_open_log_file (struct app_context *ctx, struct buffer *buffer) // or an error that includes the below message. char *path = buffer_get_log_path (buffer); if (!(buffer->log_file = fopen (path, "ab"))) - log_global_error (ctx, "Couldn't open log file `#s': #l", + log_global_error (ctx, "Couldn't open log file `#l': #l", path, strerror (errno)); else set_cloexec (fileno (buffer->log_file)); @@ -13085,6 +13086,8 @@ locale_to_utf8 (struct app_context *ctx, const char *locale, const char *p = locale; // Reset the shift state, FWIW + // TODO: Don't use this iconv handle directly at all, elsewhere in xC. + // And ideally use U+FFFD with EILSEQ. (void) iconv (ctx->term_to_utf8, NULL, NULL, NULL, NULL); bool fixed[n_indexes]; @@ -13456,7 +13459,7 @@ static void input_editor_cleanup (struct app_context *ctx) { if (unlink (ctx->editor_filename)) - log_global_error (ctx, "Could not unlink `#s': #l", + log_global_error (ctx, "Could not unlink `#l': #l", ctx->editor_filename, strerror (errno)); cstr_set (&ctx->editor_filename, NULL); -- cgit v1.2.3-70-g09d2