From 6f97ebda2ce2012ca79cdb1929f20e5db73f799b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Mon, 26 May 2008 22:20:36 +0200 Subject: [PATCH] New kludge to access Locale.Charset.decoder(). Rev: lib/modules/Locale.pmod/module.pmod:1.24 --- lib/modules/Locale.pmod/module.pmod | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/modules/Locale.pmod/module.pmod b/lib/modules/Locale.pmod/module.pmod index f4bba47e2e..4359b03520 100644 --- a/lib/modules/Locale.pmod/module.pmod +++ b/lib/modules/Locale.pmod/module.pmod @@ -206,6 +206,10 @@ class LocaleObject } } +// Used to delay lookup of the Charset module until run-time when dumped, +// and thus resolve the circularity. +static object(Locale) locale = Locale; + object get_object(string project, string lang) { // Is there such a project? @@ -279,7 +283,7 @@ object get_object(string project, string lang) { default: object dec; // FIXME: Is this the best way of using Locale.Charset.decoder ? - if(catch(dec = .Charset.decoder(encoding))) { + if(catch(dec = locale.Charset.decoder(encoding))) { werror("\n* Warning: unknown encoding %O in %O\n", encoding, filename); break; -- GitLab