Error Opening Project: Reference to invalid character number at line x
From Audacity Development Manual
This error message usually means that when reopening the AUP project file normally, Audacity finds an unexpected non-English, accented or control character at the line quoted in the error message. There are three main causes of this.
- The project contains imported files whose metadata contains symbols that Audacity cannot display. This may create either the "(invalid token)" or "invalid character number" error
- The project was saved containing non-English or accented characters using an old ANSI build of Audacity for Windows. ANSI builds are not properly Unicode aware, so do not support non-English or accented characters.
- The latest version of Audacity will always fully support Unicode. You can check your Audacity version at (or on Mac).
Solution:
- Make a copy of the AUP project file and open it in a text editor. You can use the default Notepad on Windows or TextEdit on Mac, but in a few instances these could change the AUP file in such a way that Audacity could no longer open it. We recommend instead Notepad++ for Windows and Brackets or BBEdit for Mac.
- Turn word wrap off in the menus (or in TextEdit, drag the window horizontally so that lines do not wrap).
- In the line indicated in the error message, look for one of these:
- projname=
- name=
- value=
- title=
then remove all characters inside the quotation marks that follow which are not a number or an A to Z letter. You could also change those characters to a number or A to Z letter. For example, a string of control characters you would want to remove or change might start with &# followed by four numbers and a semi-colon, such as &# 0 0 1 3 ;.
For symbols there will usually be five characters between the &# and a colon.
- Save the changes to the .aup file.
- If you re-open the project and an error occurs at another line, repeat the steps above in the new line indicated in the error message.
Here is a real-world example of a corrupt line in the GENRE tag in a project where "Country" and "Western" were incorrectly separated using the control character for a horizontal tab, also missing the closing semi-colon:
<tag name="GENRE" value="Country &# 0 0 0 9 Western"/>
And the same line corrected so that the two words can be read into the project:
<tag name="GENRE" value="Country, Western"/>