Accents are lost when saving Word file with VBA in Python

I’m coding in Python in order to update a Word Document (loaded as DOCX) to contain VBA code.
This VBA code will change a ContentControl everytime a Dropdown menu selection changes and so far programming this on Aspose.words is working.

What isn’t working is that when saving this file as DOCM, all accents previously written in VBA are lost, and the letters are overwritten by their closest non-accent counterpart, for instance, ‘ã’ becomes ‘a’, ‘ç’ becomes ‘c’ and so on.

I’ve tried using aw.loading.EditingLanguage.PORTUGUESE_BRAZIL for both add_editing_language and default_editing_language when opening a new file, but that didn’t change anything. In fact, doc.styles.default_font.locale_id returns a different ID than PORTUGUESE_BRAZIL.

I’ve also tried looking for encoding options on OoxmlSaveOptions, but they don’t seem to be available.

Here’s a snippet of the VBA code I’m getting right after saving:

 ElseIf ContentControl.Tag = "Margem_Esquerda_Master" Then
    Set oNode = ContentControl.XMLMapping.CustomXMLPart.SelectSingleNode(Replace(ContentControl.XMLMapping.XPath, "Margem_Esquerda_Master", "Margem_Esquerda_Slave"))
    Select Case Content
      Case "Teste1"
        oNode.Text = "Caracteres sao perdidos."
      Case "Teste2"
        oNode.Text = "Autoafirmacao"      
      Case Else
        oNode.Text = "Opcao ainda nao escolhida."
      End Select

Needless to say, the original VBA code did have the accents in place.

How to keep Brazilian Portuguese accents when saving VBA code in DOCM?
Thank you in advance for your support.

@thrmotta Could you please attach your source and output documents here for testing? We will check the issue and provide you more information.

Sure, here they are

src.7z (194.6 KB)

@thrmotta
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25332

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as WORDSNET-25332) have been fixed in this Aspose.Words for .NET 23.5 update also available on NuGet.