diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Replace non-ASCII output glyphs with ASCII
-rw-r--r--source/ui-atom.c4
-rw-r--r--source/ui-blob.c6
-rw-r--r--source/ui-log.c11
-rw-r--r--source/ui-shared.c5
4 files changed, 12 insertions, 14 deletions
diff --git a/source/ui-atom.c b/source/ui-atom.c
index b0adbf1..bc13367 100644
--- a/source/ui-atom.c
+++ b/source/ui-atom.c
@@ -24,8 +24,8 @@ static const char *feed_date(timestamp_t when)
return show_date(when, 0, date_mode_from_type(DATE_ISO8601_STRICT));
}
-// U+FFFD, which stands in for every byte the feed cannot carry.
-#define XML_REPLACEMENT "\xef\xbf\xbd"
+// Stands in for every byte the feed cannot carry.
+#define XML_REPLACEMENT "?"
/*
* How many bytes the UTF-8 sequence at p holds, or 0 when the bytes there are
diff --git a/source/ui-blob.c b/source/ui-blob.c
index 8f68d04..1088679 100644
--- a/source/ui-blob.c
+++ b/source/ui-blob.c
@@ -128,15 +128,15 @@ int cgit_print_file(char *path, const char *head, int file_only, int html_escape
buf[size] = '\0';
if (html_escape) {
// html_txt stops at a NUL, so a blob holding one is written
- // segment by segment with a replacement character standing in
- // for each NUL byte, rather than silently cut short.
+ // segment by segment with a question mark standing in for
+ // each NUL byte, rather than silently cut short.
const char *p = buf, *end = buf + size;
while (p < end) {
html_txt(p);
p += strlen(p);
while (p < end && !*p) {
- html("\xef\xbf\xbd");
+ html("?");
p++;
}
}
diff --git a/source/ui-log.c b/source/ui-log.c
index ec5f91b..7b7808c 100644
--- a/source/ui-log.c
+++ b/source/ui-log.c
@@ -160,15 +160,14 @@ static void print_graph_above(struct rev_info *revs, struct strbuf *graph,
}
/*
- * Cuts a subject longer than max-message-len down to size, leaving an arrow
- * where it was cut and moving the remainder to the front of msg. The subject
- * is edited in place, which the caller allows by freeing the commitinfo once
- * the row is written.
+ * Cuts a subject longer than max-message-len down to size, leaving an
+ * ellipsis where it was cut and moving the remainder to the front of msg. The
+ * subject is edited in place, which the caller allows by freeing the
+ * commitinfo once the row is written.
*/
static void wrap_subject(struct commitinfo *info, struct strbuf *msg)
{
- // The arrow is U+21B5 written out in PAGE_ENCODING.
- const char wrap_symbol[] = { ' ', 0xE2, 0x86, 0xB5, 0 };
+ const char wrap_symbol[] = " ...";
size_t subject_len = strlen(info->subject);
int cut;
diff --git a/source/ui-shared.c b/source/ui-shared.c
index 317bff2..6460e64 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -1765,12 +1765,11 @@ void cgit_set_title_from_path(const char *path)
return;
// The path is read from the end so that the title names the file first
- // and the directories it sits in after it. The separator between them
- // is a guillemet, spelled here as the UTF-8 bytes of one.
+ // and the directories it sits in after it.
last_slash = path + strlen(path);
while ((slash = find_last_char(path, last_slash, '/')) != NULL) {
strbuf_add(&sb, slash + 1, last_slash - slash - 1);
- strbuf_addstr(&sb, " \xc2\xab ");
+ strbuf_addstr(&sb, " < ");
last_slash = slash;
}
strbuf_add(&sb, path, last_slash - path);