Skip to content

Fix codepage conversion issues - #12115

Merged
kryksyh merged 7 commits into
audacity:masterfrom
kryksyh:fix_codepage
Sep 17, 2026
Merged

kryksyh merged 7 commits into
audacity:masterfrom
kryksyh:fix_codepage

Conversation

@kryksyh

@kryksyh kryksyh commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Resolves: (#8267)
those issues mostly present on windows only and depend on system locale

  • - Input devices containing non-ascii chars can not be selected on windows
  • - Metadata fields containing non-ascii chars were corrupted
  • - Some translated undo items were corrupted
  • - Opening a project from non-ascii path created corrupted "recent files" records
  • - Export error messages containded corrupted text if path contained non-ascii chars
  • - Effect presets named with non-ascii chars were corrupted
  • - ffmpeg path could not contian non-ascii chars
  • - Can't create a project if windows user name contains non-ascii characters
  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Testflow test cases have been run

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 0fb587a0-c738-4086-94be-69856258e8e1

📥 Commits

Reviewing files that changed from the base of the PR and between 2d75dcc and fe5c031.

📒 Files selected for processing (35)
  • au3/libraries/au3-project-file-io/ProjectFileIO.cpp
  • au3/libraries/au3-vst3/VST3EffectBase.cpp
  • au3/libraries/au3-vst3/VST3EffectsModule.cpp
  • au3/libraries/au3-vst3/VST3Utils.cpp
  • au3/modules/import-export/mod-ffmpeg/lib-ffmpeg-support/wrappers/AVFormatContextWrapper.cpp
  • src/au3audio/internal/au3audiodrivercontroller.cpp
  • src/au3audio/internal/au3audioengine.cpp
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/au3cloud/internal/au3cloudservice.cpp
  • src/au3wrap/internal/au3commonsettings.cpp
  • src/au3wrap/internal/au3project.cpp
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/internal/abstractviewlauncher.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/effectconfigsettings.cpp
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectpresetsprovider.cpp
  • src/effects/effects_base/internal/effectpresetsscenario.cpp
  • src/effects/effects_base/internal/effectsactionscontroller.cpp
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/missingeffectchecker.cpp
  • src/effects/effects_base/internal/realtimeeffectservice.cpp
  • src/effects/effects_base/view/effectpresetsbarmodel.cpp
  • src/effects/effects_base/view/effectsavecontextmenu.cpp
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.cpp
  • src/effects/nyquist/internal/nyquistparameterextractorservice.cpp
  • src/importexport/export/internal/au3/au3exporter.cpp
  • src/importexport/export/internal/au3/au3ffmpegoptionsaccessor.cpp
  • src/project/internal/au3/au3metadata.cpp
  • src/project/tests/CMakeLists.txt
  • src/project/tests/projectrecovery_tests.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp
  • src/trackedit/internal/au3/au3projecthistory.cpp

📝 Walkthrough

Walkthrough

The changes replace implicit string conversions with explicit UTF-8 and wxWidgets conversion helpers across plugin, media, audio, cloud, effect, UI, metadata, export, and project flows. The project recovery path now preserves temporary-project and connection filename state when no document is loaded. New parameterized tests cover autosave states and unavailable temporary directories.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: 🔵 Low · up to 2d75d

Cancelling recovery can leave the previously open permanent project displayed as untitled. The correction is localized but should be applied before merging.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and clearly describes the primary codepage and encoding conversion fixes in the pull request.
Description check ✅ Passed The description provides the issue reference, motivation, affected scenarios, checklist responses, and QA status. It omits the AI-assistance checkbox from the template and records that testflow cases …
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kryksyh kryksyh linked an issue Sep 12, 2026 that may be closed by this pull request
@kryksyh kryksyh added this to the Audacity 4.0.1 milestone Sep 14, 2026
@kryksyh kryksyh moved this from Ready For Dev to Ready for QA in [AU4] Release Maintenance Sep 14, 2026
@chinakov chinakov moved this from Ready for QA to In QA in [AU4] Release Maintenance Sep 16, 2026
@chinakov chinakov moved this from In QA to In Progress in [AU4] Release Maintenance Sep 16, 2026
@ianalarina ianalarina linked an issue Sep 16, 2026 that may be closed by this pull request
@kryksyh kryksyh linked an issue Sep 17, 2026 that may be closed by this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 3a365c26-5051-46af-820d-cc33f6ad13f9

📥 Commits

Reviewing files that changed from the base of the PR and between 6814a133eaeea671b5c4f6f194cd4b0720d7dcf1 and 093a05c.

📒 Files selected for processing (32)
  • au3/libraries/au3-vst3/VST3EffectBase.cpp
  • au3/libraries/au3-vst3/VST3EffectsModule.cpp
  • au3/libraries/au3-vst3/VST3Utils.cpp
  • au3/modules/import-export/mod-ffmpeg/lib-ffmpeg-support/wrappers/AVFormatContextWrapper.cpp
  • src/au3audio/internal/au3audiodrivercontroller.cpp
  • src/au3audio/internal/au3audioengine.cpp
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/au3cloud/internal/au3cloudservice.cpp
  • src/au3wrap/internal/au3commonsettings.cpp
  • src/au3wrap/internal/au3project.cpp
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/internal/abstractviewlauncher.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/effectconfigsettings.cpp
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectpresetsprovider.cpp
  • src/effects/effects_base/internal/effectpresetsscenario.cpp
  • src/effects/effects_base/internal/effectsactionscontroller.cpp
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/missingeffectchecker.cpp
  • src/effects/effects_base/internal/realtimeeffectservice.cpp
  • src/effects/effects_base/view/effectpresetsbarmodel.cpp
  • src/effects/effects_base/view/effectsavecontextmenu.cpp
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.cpp
  • src/effects/nyquist/internal/nyquistparameterextractorservice.cpp
  • src/importexport/export/internal/au3/au3exporter.cpp
  • src/importexport/export/internal/au3/au3ffmpegoptionsaccessor.cpp
  • src/project/internal/au3/au3metadata.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp
  • src/trackedit/internal/au3/au3projecthistory.cpp
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/importexport/export/internal/au3/au3exporter.cpp
  • src/au3audio/internal/au3audiodrivercontroller.cpp
  • src/effects/effects_base/view/effectpresetsbarmodel.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

PluginPath VST3EffectBase::GetPath() const
{
return VST3Utils::MakePluginPathString({ mModule->getPath() }, mEffectClassInfo->ID().toString());
return VST3Utils::MakePluginPathString(wxString::FromUTF8(mModule->getPath()), mEffectClassInfo->ID().toString());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,90p' au3/libraries/au3-vst3/VST3EffectBase.cpp
sed -n '55,85p' au3/libraries/au3-vst3/VST3Utils.cpp
rg -n "MakePluginPathString" au3/libraries/au3-vst3

Repository: audacity/audacity

Length of output: 3779


🏁 Script executed:

set -eu
printf '%s\n' '--- wxWidgets version/config references ---'
rg -n --glob '!build/**' --glob '!node_modules/**' 'wxWidgets|wxString::FromUTF8|FromUTF8[[:space:]]*\(' au3 CMakeLists.txt cmake 2>/dev/null | head -200
printf '%s\n' '--- candidate wxString declarations ---'
rg -n --glob '*wxString*' --glob '*.h' --glob '*.hpp' 'FromUTF8' . 2>/dev/null | head -100

Repository: audacity/audacity

Length of output: 25341


🌐 Web query:

wxWidgets wxString FromUTF8 overload documentation wxString argument

💡 Result:

<search_synthesis>
The static method wxString::FromUTF8 is used to create a wxString object from a UTF-8 encoded string [1][2]. As of the current versions of wxWidgets, it provides the following overloads: 1. static wxString FromUTF8(const char *s) Converts a null-terminated UTF-8 C string to a wxString [2][3]. 2. static wxString FromUTF8(const char *s, size_t len) Converts a UTF-8 C string of a specified length to a wxString [2][4]. 3. static wxString FromUTF8(const std::string &s) Converts a UTF-8 encoded std::string to a wxString [2][5]. These methods assume that the input string is a valid UTF-8 sequence [4]. Validation is typically performed in debug builds, while release builds may skip it for performance reasons [4]. These functions are the recommended way to convert UTF-8 data to wxString, especially when the application uses the wxNO_IMPLICIT_WXSTRING_ENCODING compilation option to prevent unsafe implicit conversions [1][6][7].
</search_synthesis>

<source_evidence>

<title>wxString Class Reference | wxWidgets</title> https://docs.wxwidgets.org/latest/classwx_string.html - ASCII string guaranteed to contain only 7 bit characters using wxString::FromAscii(). - Narrow `char*` string in the current locale encoding using implicit wxString::wxString(const char*) constructor or using more explicit wxString::wxString(const char*, const wxMBConv&) constructor passing it wxConvLibc as the second argument. - Narrow `char*` string in UTF-8 encoding using wxString::FromUTF8(). - Narrow `char*` string in the given encoding using wxString::wxString(const char*, const wxMBConv&) constructor passing a wxCSConv corresponding to the encoding as the second argument. ... - Standard `std::string` using implicit wxString::wxString(const std::string&) constructor. Notice that this constructor supposes that the string contains data in the current locale encoding, use FromUTF8() if the string contains UTF-8-encoded data instead. ... - Standard `std::string_view` using implicit wxString::wxString(std::string_view) constructor. Notice that this constructor supposes that the string contains data in the current locale encoding, use FromUTF8() if the string contains UTF-8-encoded data instead. ... Notice that many of the constructors are implicit, meaning that you don&`#39`;t even need to write them at all to pass the existing string to some wxWidgets function taking a wxString. This is convenient, but can also be dangerous when constructing wxString from char* or std::string if it doesn&`#39`;t have the expected encoding, as the resulting string will be empty if the conversion from the current locale encoding fails. If you want to disable all such conversions at compile-time, you may predefine wxNO_IMPLICIT_WXSTRING_ENCODING when compiling the application code and the corresponding conversions become inaccessible, i.e. wxString s; // s = "world"; does not compile with wxNO_IMPLICIT_WXSTRING_ENCODING s = wxString::FromAscii("world"); // Always compiles s = wxASCII_STR("world"); // shorthand for the above s = wxString::FromUTF8("world"); // Always compiles s = wxString("world", wxConvLibc); // Always compiles, explicit encoding s = wxASCII_STR("Grüße"); // Always compiles but s may be empty! ... wxString::ToUTF8 ... CharBuffer ToUTF8() const Same as utf8_str(). ... To summarize, the safest way to use wxString is to always define wxNO_IMPLICIT_WXSTRING_ENCODING in the application compilation options to disable all implicit uses of encoding and specify it explicitly, typically by using utf8_str() or utf8_string() and FromUTF8() for conversions, for every operation. If this is impossible, for example because it would require too many changes to the existing code, consider defining wxNO_UNSAFE_WXSTRING_CONV to at least disable implicit unsafe conversions. ... This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. wxString operator+ (const wxString &x, const wxString &y) ... Concatenation: returns a new string equal to the concatenation of the operands. wxString operator+ (const wxString &x, wxUniChar y) ... This is an overloaded member function, provided for convenience. It differs from ... above function only in what argument(s) it accepts. ... const wxScopedCharBuffer ToUTF8 ... static wxString FromUTF8 (const char *s) ... Converts C string encoded in UTF-8 to wxString. static wxString FromUTF8 (const char *s, size_t len) ... Converts C string encoded in UTF-8 to wxString. FromUTF8 (const std::string &s) ... Converts C string encoded in UTF-8 to wxString. FromUTF8 (std::string_view s) ... Converts C string encoded in UTF-8 to wxString. ... FromUTF8Unchecked (const char *s) ... ## ◆ AssignFromUTF8() ... | void wxString ... AssignFromUTF8 <title>wxString Class Reference | wxWidgets</title> https://docs.wxwidgets.org/stable/classwx_string.html # Converting to ... - ASCII string guaranteed to contain only 7 bit characters using wxString::FromAscii(). - Narrow`char*` string in the current locale encoding using implicit wxString::wxString(const char*) constructor. - Narrow`char*` string in UTF-8 encoding using wxString::FromUTF8(). - Narrow`char*` string in the given encoding using wxString::wxString(const char*, const wxMBConv&) constructor passing a wxCSConv corresponding to the encoding as the second argument. - Standard`std::string` using implicit wxString::wxString(const std::string&) constructor. Notice that this constructor supposes that the string contains data in the current locale encoding, use FromUTF8() or the constructor taking wxMBConv if this is not the case. ... UngetWrite ... utf8_str ... | const wxScopedCharBuffer | ToUTF8() const | | Same as utf8_str(). More... | ... | static wxString | FromUTF8(const char *s) | | Converts C string encoded in UTF-8 to wxString. More... | ... | static wxString | FromUTF8(const char *s, size_t len) | | Converts C string encoded in UTF-8 to wxString. More... | ... | static wxString | FromUTF8(const std::string &s) | | Converts C string encoded in UTF-8 to wxString. More... | <title>wxString Overview | wxWidgets</title> https://docs.wxwidgets.org/latest/overview_string.html wxString Overview | wxWidgets | Version: 3.3.3 | | --- | wxString Overview wxString is used for all strings in wxWidgets. This class is very similar to the standard string class, and is implemented using it, but provides additional compatibility functions to allow applications originally written for the much older versions of wxWidgets to continue to work with the latest ones. When writing new code, you&`#39`;re encouraged to use wxString as if it were std::wstring and use only functions compatible with the standard class. # wxString Related Compilation Settings The main build options affecting wxString are wxUSE_UNICODE_WCHAR and wxUSE_UNICODE_UTF8, exactly one of which must be set to determine whether fixed-width wchar_t or variable-width char-based strings are used internally. Please see Choosing Unicode Representation for more information about this choice. The other options all affect the presence, or absence, of various implicit conversions provided by this class. By default, wxString can be implicitly created from char*, wchar_t*, std::string and std::wstring and can be implicitly converted to char* or wchar_t*. This behaviour is convenient and compatible with the previous wxWidgets versions, but is dangerous and may result in unwanted conversions, please see Converting to and from wxString for how to disable them. # Iterating over wxString It is possible to iterate over strings using indices, but the recommended way to do it is to use iterators, either explicitly: wxString s = "hello"; wxString::const_iterator i; for (i = s. begin(); i != s. end(); ++i) { wxUniChar uni_ch = *i; // do something with it } String class for passing textual data to or receiving it from wxWidgets. Definition string.h:372 const_iterator begin() const const_iterator end() const This class represents a single Unicode character. Definition unichar.h:18 or, even simpler, implicitly, using range for loop: wxString s = "hello"; for ( auto c : s ) { // do something with "c" } Note wxString iterators have unusual proxy-like semantics and can be used to modify the string even when not using references, i.e. with just`auto`, as in the example above. # wxString Internal Representation NoteThis section can be skipped at first reading and is provided solely for informational purposes. As mentioned above, wxString may use any of`UTF-16`(under Windows, using the native 16 bit`wchar_t`),`UTF-32`(under Unix, using the native 32 bit`wchar_t`) or`UTF-8`(under both Windows and Unix) to store its content. By default,`wchar_t` is used under all platforms, but wxWidgets can be compiled with wxUSE_UNICODE_UTF8=1 to use UTF-8 instead. For simplicity of implementation, wxString uses per code unit indexing instead of per code point indexing when using UTF-16, i.e. in the default wxUSE_UNICODE_WCHAR==1 build under Windows and doesn&`#39`;t know anything about surrogate pairs. In other words it always considers code points to be composed by 1 code unit, while this is really true only for characters in the BMP (Basic Multilingual Plane), as explained in more details in the Unicode Representations and Terminology section. Thus when iterating over a UTF-16 string stored in a wxString under Windows, the user code has to take care of surrogate pairs manually if it needs to handle them (note however that Windows itself has built-in support for surrogate pairs in UTF-16, such as for drawing strings on screen, so nothing special needs to be done when just passing strings containing surrogates to wxWidgets functions). RemarksNote that while the behaviour of wxString when wxUSE_UNICODE_WCHAR==1 resembles UCS-2 encoding, it&`#39`;s not completely correct to refer to wxString as UCS-2 encoded since you can encode code points outside the BMP in a wxString as two code units (i.e. as a surrogate pair; as already mentioned however wxString will "see" them as two different code points) In wxUSE_UNICODE_UTF8==1 case, wxString handles UTF-8 mul…[truncated] <title>wxString</title> https://docs.wxwidgets.org/2.8/wx_wxstring.html Constructors and assignment operators ... length Character access Concatenation ... Substring extraction Case conversion ... and replacing Conversion to numbers Writing values into ... string Memory management Miscellaneous wxWidgets 1.xx compatibility functions std::string compatibility functions wxString::wxString wxString::~wxString wxString::Alloc wxString::Append wxString::AfterFirst wxString::AfterLast wxString::BeforeFirst wxString::BeforeLast wxString::c_str wxString::char_str wxString::Clear wxString::Cmp wxString::CmpNoCase wxString::CompareTo wxString::Contains wxString::Empty wxString::Find wxString::First wxString::fn_str wxString::Format wxString::FormatV wxString::Freq wxString::From8BitData wxString::FromAscii wxString::FromUTF8 wxString::GetChar wxString::GetData wxString::GetWritableChar wxString::GetWriteBuf wxString::Index wxString::IsAscii wxString::IsEmpty wxString ... IsNull wxString ... IsNumber wxString::IsSameAs wxString::IsWord wxString::Last wxString ... Left wxString ... Len wxString::Length wxString::Lower wxString::LowerCase wxString::MakeLower wxString::MakeUpper wxString::Matches wxString::mb_str wxString::Mid wxString::Pad wxString::Prepend wxString ... Printf wxString::PrintfV wxString ... Remove wxString ... Replace wxString::Right wxString ... Shrink wxString ... StartsWith wxString ... EndsWith wxString ... SubString wxString ... To8BitData ... ToAscii wxString ... ToDouble wxString::ToLong wxString ... ToLongLong wxString ... ToULong ... ULongLong wxString ... ToUTF8 wxString ... Trim wxString::Truncate wxString ... UngetWriteBuf wxString::Upper wxString::UpperCase wxString::utf8_str wxString::wc_ ... wxString::operator! wxString ... operator + wxString ... operator += wxString ... operator () wxString ... operator >> wxString ... * Comparison operators ... ### wxString::FromUTF8 ... static wxString FromUTF8(const char* s) ... static wxString FromUTF8(const char* s, size_t len) ... Converts C string encoded in UTF-8 to wxString. ... Note that this method assumes that s is a valid UTF-8 sequence and doesn&`#39`;t do any validation in release builds, it&`#39`;s validity is only checked in debug builds. ... ### wxString::utf8_str <title>UTF-8 std::string interoperability</title> GitHub issue 17461 in wxWidgets/wxWidgets (link omitted to avoid creating a cross-reference) # UTF-8 std::string interoperability - State: closed - Author: wxtrac - Created: 2016-03-24T18:21:57Z - Updated: 2016-04-24T18:14:59Z - Repository: wxWidgets/wxWidgets - Number: `#17461` ## Labels - low priority - base - feature - v3.1 --- *Issue migrated from trac ticket # 17461* **component:** base | **priority:** low | **resolution:** fixed | **keywords:** UTF-8, wxString, std::string #### 2016-03-24 18:21:57: `@minoki` created the issue ___ It is necessary to convert wxString to/from std::string when one uses std::string in non-GUI code. There have been member functions and conversion constructors to do that. However, there is no canonical way to convert to/from **UTF-8** std::string, not using locale-dependent encoding. Existing methods to handle UTF-8 strings are inconvenient because one has to choose between - to end up with `.c_str()`, and let library recalculate string length every time, and give up correct handling of embedded NULs, or - to bother to pass around the length of the string. So I propose to add canonical methods to handle UTF-8 std::string. ## UTF-8 std::string to wxString Add overloads for wxString::FromUTF8/FromUTF8Unchecked: ```c++ /* In class wxString: */ `#if` wxUSE_STD_STRING static wxString FromUTF8(const std::string &s); static wxString FromUTF8Unchecked(const std::string &s); `#endif` ``` ## wxString to UTF-8 std::string Add a member function to wxString: ```c++ /* In class wxString: */ `#if` wxUSE_STD_STRING std::string utf8_std_str() const; // the name is hypothetical `#endif` ``` If it is unfavorable to add yet another member function when we already have `utf8_str()` and `ToStdString()`, there are two options I came up with: 1. Add a `wxMBConv` parameter to `wxString::ToStdString()` and write `str.ToStdString(wxConvUTF8)`. 2. Add a conversion operator for `wxScopedCharBuffer` returning a `std::string`. ## Notes If you use UTF-8 build of wx and want to avoid unnecessary copies, adding overloads with rvalue reference might be an option: ```c++ /* In class wxString: */ `#if` wxUSE_STD_STRING && ... /* ... we have rvalue references ... */ std::string utf8_std_str() &&; static wxString FromUTF8(std::string&& s); static wxString FromUTF8Unchecked(std::string&& s); `#endif` }; ``` We may also add `std::string` overloads for the following functions, but it would be of lower priority. - `wxString::FromAscii` - `wxString::From8BitData` - `wxUString::FromAscii` - `wxUString::FromUTF8` ## Timeline **wxtrac** commented on 2016-03-24T18:35:05Z: > #### 2016-03-24 18:35:05: `@minoki` commented > > > ___ > I prepared a commit resolving &`#39`;UTF-8 std::string to wxString&`#39`; part (i.e. add `wxString::FromUTF8(std::string)` overload): > https://github.com/minoki/wxWidgets/commit/31e92d92e1e2325a02a71cd6a63a4afa13a5a5dd > > You can just merge the branch, or cherry-pick the commit. Or, should I make a pull request? **wxtrac** commented on 2016-03-24T19:30:07Z: > #### 2016-03-24 19:30:07: `@minoki` commented > > > ___ > I slightly updated the commit to eliminate `#if wxUSE_STL_BASED_WXSTRING`: > https://github.com/minoki/wxWidgets/commit/2ffd04643ea63cddc64752c7f91d24119733b6a2 > It is `push -f`-ed to the same branch. **wxtrac** commented on 2016-03-24T21:35:11Z: > #### 2016-03-24 21:35:11: `@vadz` changed priority from *normal* to *low* > #### 2016-03-24 21:35:11: `@vadz` changed status from *new* to *confirmed* > #### 2016-03-24 21:35:11: `@vadz` commented > > Thanks, I agree it would be useful to have this, and adding `FromUTF8()` overloads is absolutely uncontroversial. > > I&`#39`;m less sure about `utf8_std_str()` as this is yet another function to tell people about and explain how it is different from the rest. Adding `wxMBConv` parameter to `ToStdString()` seems like a better idea to me. > > As for using rvalue references, let&`#39`;s leave this for a separate patch/PR/ticket as it&`#39`;s unrelated, even if this …[truncated]

Citations:


🏁 Script executed:

set -eu
rg -n --hidden --glob '!build/**' --glob '!node_modules/**' \
  'wxNO_IMPLICIT_WXSTRING_ENCODING|wxNO_UNSAFE_WXSTRING_CONV|wxUSE_UNICODE_UTF8|wxUSE_UNICODE_WCHAR|wxWidgets.*version|WXWIDGETS' \
  . 2>/dev/null | head -200

Repository: audacity/audacity

Length of output: 637


🏁 Script executed:

set -eu
rg -n -C 3 'VST3EffectBase::GetPath|GetPath[[:space:]]*\(|PluginPath' \
  au3/libraries/au3-vst3 au3/libraries/au3-components au3 2>/dev/null | head -240

Repository: audacity/audacity

Length of output: 18402


Return the helper result directly. MakePluginPathString returns wxString. FromUTF8 has no wxString overload, but the default wxWidgets configuration allows an implicit conversion to current-locale narrow text before FromUTF8 decodes it. A non-UTF-8 locale can therefore change a non-ASCII module path. This path implements ComponentInterface::GetPath and is later parsed for plugin loading.

Suggested change
return VST3Utils::MakePluginPathString(wxString::FromUTF8(mModule->getPath()), mEffectClassInfo->ID().toString());
return VST3Utils::MakePluginPathString(wxString::FromUTF8(mModule->getPath()), mEffectClassInfo->ID().toString());

@chinakov chinakov moved this from In Progress to In QA in [AU4] Release Maintenance Sep 17, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Restore the previous temporary state before restoring the filename. · ProjectFileIO.cpp:642-643

au3/libraries/au3-project-file-io/ProjectFileIO.cpp:642-643
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore the previous temporary state before restoring the filename.

When recovery is cancelled after the missing-document branch sets mTemporary = true, RestoreConnection() calls SetFileName(mPrevFileName) while the temporary state is still active. SetFileName() then clears the restored permanent project's name and sets its title as untitled. Move mTemporary = mPrevTemporary; before SetFileName(mPrevFileName).


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: b9096331-74a7-4f63-ad10-de7bb9f754c0

📥 Commits

Reviewing files that changed from the base of the PR and between 093a05c and 2d75dcc.

📒 Files selected for processing (3)
  • au3/libraries/au3-project-file-io/ProjectFileIO.cpp
  • src/project/tests/CMakeLists.txt
  • src/project/tests/projectrecovery_tests.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@kryksyh
kryksyh merged commit df54269 into audacity:master Sep 17, 2026
3 of 10 checks passed
@kryksyh
kryksyh deleted the fix_codepage branch September 17, 2026 13:37
kryksyh added a commit that referenced this pull request Sep 22, 2026
Fix codepage conversion issues (#12115)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Audacity always uses system default input on Windows Cannot start "New project" Saving Presets with Unicode Symbols

2 participants