Today when I opened the .aup file of my latest episode I get the following:
[quote]Error: reference to invalid character number at line 57.[/quote]
After a Google search I tried opening the file with Notepad to edit as recommended in the following FAQ “Why do I get “Error: not well formed (invalid token) at line x”?”
I found the source (not how to fix)of the original problem.
Turns out one of the audio file I inserted in that .aup had a sort of emoji in it’s name.
I didn’t notice it before inserting (which worked till I had to re-open the file) and I had never that.
This emoji is likely responsible for that “��” bit appearing as part of the file name (two places) in the code when opening the aup with Wordpad
So in the end, what was needed after applying the “Why do I get “Error: not well formed (invalid token) at line x”?” method was to put the setting “ANSI” when doing Save As in Notepad.
By default it was on a different setting and that’s apparently why it would open in Audacity after saving.
Audacity project files are encoded as UTF-8 but Notepad’s choice for saving as that adds a BOM which Audacity can’t interpret.
Saving as ANSI would leave you with more invalid token errors if you had Unicode characters in the file. So in some cases you’re never going to be able use Notepad to correct the file.
The result is that thereafter Notepad always defaults to UTF-8 (you can always manually override with the “Encoding” dropdown. Assuming (?) Audacity can open UTF-8 encoded AUP files (it has no problem opening other UTF-8 files), this might solve the open problem. Writing the AUP (an XML file) might want to be changed so it is an UTF-8 file…
This is an (truncated) AUP from Audacity 2.0:
We’re talking about editing AUP files not creating new ones, but as far as I can see Notepad on Windows 10 does not change the encoding of an existing UTF-8 AUP file to ANSI, even if its last Save As was ANSI.
Notepad does however add BOM to the UTF-8 encoding as I said, and that does then render the file unopenable in Audacity. To open the AUP file you would then have to remove the BOM in a more advanced editor like Notepad++.
Fortunately if the project contains no Unicode characters, then Audacity saves the AUP file as ANSI, and in that case you can open the AUP file in Notepad, then edit and save. The file remains as ANSI and Audacity can still open it.