From 95563968456b51903c56b75e05e47959405c388f Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Thu, 30 Jun 2005 15:33:23 +0000 Subject: [PATCH] second part of fixing URL printing: escape back all characters above 0x7f note that it may happen that some incorrect words get highlighted after we cut the escaped URL into words by lexmapper, but this is much better than producing incorrect UTF-8 stream --- lib/url.c | 2 +- lib/url.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/url.c b/lib/url.c index f805e32f..e38238ec 100644 --- a/lib/url.c +++ b/lib/url.c @@ -50,7 +50,7 @@ static void CONSTRUCTOR url_init_config(void) /* Escaping and de-escaping */ -static uns +uns enhex(uns x) { return (x<10) ? (x + '0') : (x - 10 + 'A'); diff --git a/lib/url.h b/lib/url.h index 30fc8fd7..b7cb8bfb 100644 --- a/lib/url.h +++ b/lib/url.h @@ -45,6 +45,7 @@ struct url { byte *buf, *bufend; }; +uns enhex(uns x); int url_split(byte *s, struct url *u, byte *d); int url_normalize(struct url *u, struct url *b); int url_canonicalize(struct url *u); -- 2.39.2