<<< Date Index >>>     <<< Thread Index >>>

Re: short assumed (was: alternates (was: What should go into 1.5.7?))



On Fri, Feb 04, 2005 at 10:43:48PM +0100, Alain Bench wrote:
>  On Thursday, February 3, 2005 at 11:41:27 PM +0900, Tamotsu Takahashi wrote:
> 
> > On Thu, Feb 03, 2005 at 01:50:04AM +0100, Alain Bench wrote:
> >> U+FFFD character (???)
> 
>     Not in your charset, so replacement char itself replaced by three
> question marks in my quote. EUC-JP terminal?

Yes, I wrote the message on an EUC-JP terminal.
But I understood you.


> > Why does it prevent mutt_convert_string() from masking unconvertible
> > chars? Or it doesn't?
> 
>     I suppose not. With short.3 I see unconvs all masked, just with
> different chars (U+003F in body versus U+FFFD in headers). With your
> additional mini-patch on outrepl, all is masked by U+003F. Fine.

Pager doesn't use U+FFFD?
Should iswprint(0xfffd) be zero?
If iswprint(0xfffd) returns zero,
we need the attached patch.
If not, I don't know why pager doesn't use 0xfffd.


>     Otherwise, if you really see unconvertable not masked, please give
> us an example, and used settings.

Looks like that I didn't have proper font, or
MLTerm was unable to handle U+FFFD.
Raw Korean strings in headers were shortened
when $assumed_charset was set to us-ascii
(and charset=utf-8).
I think they were masked but not displayed,
because I saw '?' after modifying mutt_convert_string().

So, there is no problem in mutt.


> >> it may seem logical to use [U+FFFD] to replace unconvertables, where
> >> available, in all sorts of Unicode, in GB18030... Discussable.
> 
>     It would have to be used for body too. And probably have a user
> settable masking char could be interesting. Better a multi-char list,
> where the first available in $charset would be used. With something as
> "U+FFFD:U+003F" as default.

replacement_char() returns 0xfffd when your charset is UTF-8,
returns '?' when your charset is something else.

-- 
tamo
--- curs_lib.c~ Fri Feb  4 17:49:57 2005
+++ curs_lib.c  Sat Feb  5 07:57:30 2005
@@ -611,7 +611,7 @@
       w = 1; /* hack */
     else
     {
-      if (!IsWPrint (wc))
+      if (!IsWPrint (wc) && wc != replacement_char ())
        wc = '?';
       w = wcwidth (wc);
     }
@@ -716,7 +716,7 @@
       k = (k == (size_t)(-1)) ? 1 : len;
       wc = replacement_char ();
     }
-    if (!IsWPrint (wc))
+    if (!IsWPrint (wc) && wc != replacement_char ())
       wc = '?';
     w = wcwidth (wc);
     if (w >= 0)
@@ -755,7 +755,7 @@
       k = (k == (size_t)(-1)) ? 1 : n;
       wc = replacement_char ();
     }
-    if (!IsWPrint (wc))
+    if (!IsWPrint (wc) && wc != replacement_char ())
       wc = '?';
     w += wcwidth (wc);
   }