Displaying non-ascii file names in bwx-console

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Displaying non-ascii file names in bwx-console

yistoneriver
Hello,

I saw a thread posted in Bacula-Users that Windows bwx-conosle did not display non-ascii characters correctly if they are included in files names (the file names are  garbled) .

I am not familiar with wxWidget, but  converting UTF8 characters from wide characters in local encodings seem to fix  the problem.

In ConvertToPrintable methond (wx-console/wxbutils.cpp), replace
        return str;
with
         wxString strnew(str.wc_str(wxConvUTF8), *wxConvCurrent);
         return strnew;

On the other hand, a file name in wide characters from console input (ex. to mark files to restore) should be converted to UTF8.

In OnEnter method (wx-console/wxbmainframe.cpp), replace
        Send(str);
with
        wxString strnew(str.wc_str(*wxConvCurrent), wxConvUTF8);
          Send(strnew);

So far, non-ascii file names (Japanese in my case) are displayed correctly.

Regards,
Yuji