bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [Bug-Wget][BUG] Progress bar does not support multibyte c


From: Darshit Shah
Subject: Re: [Bug-wget] [Bug-Wget][BUG] Progress bar does not support multibyte characters
Date: Fri, 12 Sep 2014 15:50:11 +0530

I managed to hack together a fix for the issue. It wasn't as
straightforward as I was expecting it to be. I've attached a
preliminary version of the patch here for a review.

Please review the patch and test it out to ensure that it works
correctly. I'll clean up the variable names and write the relevant
ChangeLog entries later and submit the final patch.

On Thu, Sep 4, 2014 at 10:34 PM, Giuseppe Scrivano <address@hidden> wrote:
> Darshit Shah <address@hidden> writes:
>
>> Yes, I guess I'm looking for UTF-8 strings, because other character
>> encodings wouldn't create this problem, (I think?)
>> I'll look at the Wiki page again and see of GNULib has anything, Right
>> now, I'm trying to implement a solution based on wide characters
>> through wchar.h but I don't like the code I've written. I's prefer
>> something more elegant and efficient.
>
> have you had a look at the mbiter module of gnulib?  Its documentation
> says that you can turn:
>
>       char *iter;
>       for (iter = buf; iter < buf + buflen; iter++)
>         {
>           do_something (*iter);
>         }
>
> into:
>
>       mbi_iterator_t iter;
>       for (mbi_init (iter, buf, buflen); mbi_avail (iter); mbi_advance
>       (iter))
>         {
>           do_something (mbi_cur_ptr (iter), mb_len (mbi_cur (iter)));
>         }
>
>
> and seems quite straightforward to me.
>
> Regards,
> Giuseppe



-- 
Thanking You,
Darshit Shah

Attachment: 0001-Handle-multibyte-characters-in-progressbar.patch
Description: Text Data


reply via email to

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