From: Robert Spalek Date: Thu, 30 Jun 2005 15:33:23 +0000 (+0000) Subject: second part of fixing URL printing: escape back all characters above 0x7f X-Git-Tag: holmes-import~763 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=95563968456b51903c56b75e05e47959405c388f;p=libucw.git 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 --- 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);