demberto / PyFLP

FL Studio project file parser

Home Page:https://pyflp.rtfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐞 `VSTPlugin.name` encoded in UTF8

smolio opened this issue · comments

commented

Describe the issue

This decoding error popped up while iterating through the channels of a project file for all instrument plugin names

Exception has occurred: UnicodeDecodeError
'ascii' codec can't decode byte 0xc2 in position 12: ordinal not in range(128)
  File "D:\Users\Beyonca\CodingProjects\Python\FLP-Analyzer\test_file.py", line 15, in <module>
    plg = channel.plugin.name #Error occurs here
          ^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 12: ordinal not in range(128)

The VST name that appears to be causing the error has a squared 2 in its name (don't ask me why)
VST_Name

I recreated a new project file isolating it to only this plugin to confirm.

What version of PyFLP are you using?

2.1.0

What code caused this issue?

import pyflp
import os

#Getting relative file path
abs_path = os.path.dirname(__file__)
rel_path = "proj_files/nonASCIIcharacters_in_VST.flp"
proj_file_path = os.path.join(abs_path, rel_path)

#Load the flp project file
proj = pyflp.parse(proj_file_path)

#Get the name of each plugin in proj file
for channel in iter(proj.channels.instruments):
    plg = channel.plugin.name #Error occurs here
    print(plg)

Screenshots, Additional info

The error screenshot
Error

The flp project
nonASCIIcharacters_in_VST.zip

Code of Conduct

  • I agree to follow this project's Code of Conduct

This is a discovery. Till now, I believed FL didn't allow non-ASCII characters as part of the plugin's factory name as the VST2 (and till some time VST3) didn't allow them (technically). The encoded string (in CP-1252) is

shortcircuit²

which in UTF8 becomes

shortcircuit²

A fix will be out soon.

@smolio Issue has been fixed in v2.1.1