Default plugin issues: can't handle files with multi-byte Unicode characters

from Issues on translating default plugins - #2 by steve



I wrote to the developer’s about this. Paul (developer) replied:

[quote=“steve”]
when I use the text export with “All” header, wxWidgets shows so

many (over 70) error alerts saying
“wxUniChar::FromHi8bit(): invalid multibyte character”
before completing export and appearing the dialog.
This seems something related with that the data import can deal only
with pure ASCII letters.

I’m not sufficiently familiar with the translation process to understand precisely what they mean
[/quote]

I don’t understand the quote either. What operating system are we talking about? What exact user actions?

What is this user doing? Trying to complete ja.po ?

I do not understand “text export with All header”. Are they even talking about Audacity or some other .po file editor that uses wxWidgets too?

I have since informed Paul that your environment is:

  • Audacity: 2.3.1-alpha-Oct 8 2018 from Audacity devel on FossHub
  • OS: Windows 7 64bit

So, please give more details, thanks.

I am a Japanese user who is trying to improve Audacity’s Japanese localization.
What I tested is “Sample Data Export”, one of the default plug-ins of Audacity.
A problem is that it throws many errors by using with my MO translation.

Steps:

  1. Unzip this (just a project file with 10-sec sine wave) and place the contents to "C:\testAudacity".
    testAudacity.zip (943 KB)
  2. Place my ja.mo (I’ve attached) and wxstd.mo to “Languages\ja” folder of Audacity.
  • The former must be renamed as Audacity.mo (I automate it by using symbolic link).
    • The latter is copied from the same directory of Audacity 2.3.0.
  1. Start Audacity.
  2. Set “Edit > Preferences… > Interface > Language:” as “日本語” (Japanese).
  3. Restart Audacity.
  4. Open C:\testAudacity\10s.aup.
  5. Select anyware of the audio.
  6. Run “Tools > Sample Data Export…”
  7. From the beginning, set as “100”, “dB”, “C:\testAudacity\export_test.txt”, “無し” (None), “無し” (None), (blank), “左右を同じ行に” (L-R on Same Line), “はい” (Yes)
  8. Press OK.

Expected behavior:

  • The result dialog is displayed and export_test.txt is generated correctly.

Actual behavior:

  • “wxWidgets Debug Alert” appears (see my screenshot at the end of this post).
    If you press “Continue”, the same one appears again and again.
  • After pressing “Continue” 73 times, The result dialog is displayed and export_test.txt is generated correctly.

When I reported this on my old thread, I thought it an error by writing non-ASCII letters to a file or by working on a non-ASCII path.
So I said ‘when I use the text export with “All” header’.
However, I’ve found that none of them are occurred and the error still occurs by following the above steps.
It’s… hard for me.
SampleDataExport_error.png

I think this problem is due to character encoding.
As far as I’m aware, all character encoding needs to be UTF-8.

If you are using NotePad++ with poEdit, then this topic on Stack Overflow may be relevant: https://stackoverflow.com/questions/38952564/poedit-encoding-wrong-when-opening-po-files

Thanks, but it didn’t affect.
My ja.po file didn’t have “X-Poedit-SourceCharset: UTF-8\n” line so I added it through Poedit’s catalog setting and updated mo file, but the same errors blazed away at me.
“Content-Type: text/plain; charset=UTF-8\n” line is already there.

I don’t know enough about the translation process, so I’m trying to find someone that does to help you.

At the latest commit, I confirmed that the errors we discussed here were fixed:
Sample Data Export and Regular Interval Labels never say “wxUniChar::FromHi8bit(): invalid multibyte character” now.
Super thanks!!

Ohhhh, except the garbling of completion message of Regular Interval Labels I showed there → https://forum.audacityteam.org/viewtopic.php?f=39&t=101872&start=10#p356783
Only this still occurs.