monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Does "mtn status" work correctly only with UTF-8 lo


From: Tomohisa Tanaka
Subject: Re: [Monotone-devel] Does "mtn status" work correctly only with UTF-8 locales?
Date: Mon, 22 Sep 2008 07:03:33 +0900

Dear Thomas,

Thank you for your reply.  I have already reported the problem and the
patch in https://savannah.nongnu.org/bugs/?21870, but nobody fixes it.

> Smells like a double-encoding bug,

I also think so.  The method F() and the operator % return an
i18n_format instance, which has the string encoded with user's locale
(since it is the string the gettext() returned).  So, the method
i18n_format::str() does not return an UTF-8 string.  However, the
constructor utf8() takes a string encoded with user's locale as the
argument, as follows.

|     47   string out;
|...
|     51   out += (F("Current branch: %s") % branch).str() += '\n';
|...
|    100     summary = utf8(out);

I think the constructor external() must be used for "out".  Please see
the sample fix in my report.

Regards,
Tomohisa Tanaka

2008/9/21 Thomas Keller <address@hidden>:
> Tomohisa Tanaka schrieb:
>> The following is a screenshot of the output messages of monotone v0.40
>> with the de_DE.ISO8859-1 locale.
>>
>> http://sites.google.com/site/maroontress/mtn-status/freebsd-de_DE.ISO8859-1.png
>>
>> The following is a screenshot with the de_DE.UTF-8 locale.
>>
>> http://sites.google.com/site/maroontress/mtn-status/freebsd-de_DE.UTF-8.png
>
> Hrm, I can reproduce the problem. It seems that in particular for mtn
> status there is some weird code in cmd_ws_commit.cc line 47ff which
> concatenates c-strings for each message output just to convert the final
> string in utf8(). Smells like a double-encoding bug, but since there
> doesn't seem to exist any concatenate operators nor an utf8() method in
> i18n_format and format_base, I'm not sure how to fix it (despite
> outputting the messages unbuffered directly to stdout). Is there any
> rationale why i18-formatted strings should not be concatenated?
>
> Thomas.
>
> --
> GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
> Please note that according to the EU law on data retention, information
> on every electronic information exchange might be retained for a period
> of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en
>
>
> _______________________________________________
> Monotone-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/monotone-devel
>
>



-- 
Tomohisa Tanaka
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]