Filter löschen
Filter löschen

Why does MATLAB crash with the message "mxCreateString called with non-UTF-8 input" in R2022a and newer releases?

10 Ansichten (letzte 30 Tage)
I recently upgraded to R2022a or later. However, MATLAB crashes for various workflows, and the crash report shows a failed assertion with the message "mxCreateString called with non-UTF-8 input". The same code was working fine in older versions of MATLAB.
Here is a snippet from the crash log:
Assertion in struct mxArray_tag *__cdecl `anonymous-namespace'::MxCreateStringNCharsT_safe<char>::operator
()(const char *,const char *,unsigned __int64) const at B:\matlab\foundation\matrix\src\matrix\array2.cpp line 500:
mxCreateString called with non-UTF-8 input: ß-phase

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 1 Mär. 2024
Bearbeitet: MathWorks Support Team am 1 Mär. 2024
In the MATLAB R2022a release, an internal change was introduced that may lead to a crash accompanied by the error message: "mxCreateString called with non-UTF-8 input." This message indicates a compatibility issue with non-UTF-8 encoded data.
We have compiled a list of scenarios known to provoke the assertion, along with corresponding workarounds. Detailed resolutions and updates can be found in the associated bug reports.
  1. Reading XLS files containing invalid UTF-8 characters read with 'xlsread' in 'basic' mode can cause MATLAB to crash (Bug Report 3138975).
  2. Loading a MAT file created with a third-party tool that contains non-UTF-8 encoded strings (e.g. variable names, field names). Note that MAT files exported from MATLAB should not include any unsupported characters.
  3. Connecting to a Raspberry Pi that uses non-UTF encoding. To resolve this, go to Raspberry Pi Configuration settings->Localisation->Locale->Set locale button. Ensure that the character set is set to UTF-8.
  4. Connecting to a camera that has non-ASCII character property values might cause MATLAB to crash (Bug Report 2988516).
  5. Calling an external shared library (for example DLL) using "loadlibrary" and "calllib" in MATLAB, and a non-UTF-8 encoded string is passed to MATLAB. To work around this issue, contact the author of the DLL and request them to modify the source code so that the DLL returns UTF-8 encoded strings, ensuring compatibility with MATLAB R2022a and beyond.
  6. The 'insertText', 'insertObjectAnnotation', and 'listTrueTypeFonts' functions cause a MATLAB crash for non-UFT-8 fonts (Bug Report 2784831)
  7. Haver Analytics database data requests crash MATLAB (Bug Report 2851278)
If your use case is not listed above, or you need further assistance or information, please contact MathWorks Technical Support with reproduction steps and code:

Weitere Antworten (0)

Kategorien

Mehr zu Programming Utilities finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by