Mobu 2023 python : UTF-8 codec error

Hello everyone,

I am working with Mobu 2023 and I have a small issue that I can’t seem to figure out.

for item in pyfbsdk.FBSystem().Scene.Components:
    if "c7" in item.Name:

Traceback (most recent call last):
if “c7” in item.Name:
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xae in position 9: invalid start byte

it’s the typical issue, it work on my PC but not on my coworker PC and I can’t seem to figure out why. Also it work in MB2018 (the code is py2, py3 compatible) for everyone.

Is someone else ever encounter this situation? (and how to fix it hihi)


Maybe different system locale? Had similar issues in another program and found this helpful python - Temporarily override locale with a context manager - Stack Overflow

1 Like

As a complement of information if user face the same issue.

The problem come from Autodesk MB2023 displaying all component from your computer, so if someone plug a Microsoft® Webcam the “®” is the issue.

Autodesk is aware of the issue and working on a patch.

If you run into this issue (need to itterate the whole scene component) the problem happen on the check of the name (not the object ifself) so you can Try: Except UnicodeDecodeError: or check the “If isinstance(item, FBModel)”.