utf-8 error during upload from Fusion360

Exchange information regarding Buildbotics post processors for CAD/CAM programs.
Post Reply
BiuTse
Posts: 19
Joined: Tue Mar 03, 2020 8:57 pm

utf-8 error during upload from Fusion360

Post by BiuTse » Sat Apr 11, 2020 7:04 am

After success with Vcarve, I tried to upload a fusion360 nc code and got the following error:
"code":500,"message":"'utf-8' codec can't decode bytes in position 240-241: invalid continuation byte"}

What could it be?

BiuTse
Posts: 19
Joined: Tue Mar 03, 2020 8:57 pm

Re: utf-8 error during upload from Fusion360

Post by BiuTse » Sat Apr 11, 2020 7:08 am

Ok found the problem.
In German we use "Umlaut" ä ü ö and I called my Endmill "Schaftfräser" (German Word for an Endmill)

So is this a bug or a configuration error on my side? Because today this shouldn't be any problem at all.

BiuTse
Posts: 19
Joined: Tue Mar 03, 2020 8:57 pm

Re: utf-8 error during upload from Fusion360

Post by BiuTse » Wed Apr 15, 2020 5:20 am

It is a problem of the post processor. I tried other ones and they generate a file with the english name of the tool, but using buildbotics processor it exports the localized tool name (in my case the german name)

I tried to look into the cps file and compare it with another working cps file but couldn't find the problem.
They use the same getToolTypeName(tool.type) function.

Any ideas?

User avatar
Doug
Posts: 125
Joined: Fri Feb 02, 2018 4:56 pm

Re: utf-8 error during upload from Fusion360

Post by Doug » Thu Apr 16, 2020 10:59 am

Sorry, I don't really understand what you are saying. At what point does the system try to export the tool name?

BiuTse
Posts: 19
Joined: Tue Mar 03, 2020 8:57 pm

Re: utf-8 error during upload from Fusion360

Post by BiuTse » Thu Apr 16, 2020 11:41 am

The generated Gcode from the buildbotics postprocessor exports the tool name in the user language
See "Tool used" it should be "Schaftfräser"

Code: Select all

%
(1001)
(Bearbeiten)
(  Hersteller: Buildbotics LLC)
(  description: Buildbotics 4-Axis CNC Controller)

(Simulation Data)
(STOCK/BLOCK, 120, 250, 10, 120, 0, 10)
(FROM/0,0,15.000)

(Tools used)
(T1 D=8 CR=0 - ZMIN=-7.5 - Schaftfr‰§ser)

N10 G90 G94 (Absolute distance mode; Feed in units per minute)
N15 G17 (using XY plane)
N20 G21 (Metric Units)
N25 G0 G91 Z10
N30 G90

(2D-Tasche1)
same export with another postprocessor (March3) Toolname (FLAT END MILL) is english:

Code: Select all

(1001)
(T1  D=8. CR=0. - ZMIN=-7.5 - FLAT END MILL)
G90 G94 G91.1 G40 G49 G17
G21
G28 G91 Z0.
G90

User avatar
Doug
Posts: 125
Joined: Fri Feb 02, 2018 4:56 pm

Re: utf-8 error during upload from Fusion360

Post by Doug » Thu Apr 16, 2020 2:06 pm

I made an attempt to fix the problem and pushed the new version to github. Our postprocessor repo on github can be accessed at: https://github.com/buildbotics/bbctrl-posts .

Please let me know whether you can get it and whether it worked.

BiuTse
Posts: 19
Joined: Tue Mar 03, 2020 8:57 pm

Re: utf-8 error during upload from Fusion360

Post by BiuTse » Fri Apr 17, 2020 4:53 am

Yes it works Now it doesn't try to write "ä" letter. Perfect

What did you change? I tried to find the problem in cps file

Thx

User avatar
Doug
Posts: 125
Joined: Fri Feb 02, 2018 4:56 pm

Re: utf-8 error during upload from Fusion360

Post by Doug » Fri Apr 17, 2020 9:19 am

I noticed that the Mach3 post processor uses a different "formatComment" function. The Mach3 version uses the JavaScript String object, while mine did not. I just replaced my formatComment function with the one in the Mach3 post processor.

I'm not an expert in JavaScript, but apparently the String object handles "Locales" internally.

Thanks pointing out the problem and getting me to compare to the Mach3 post.

Post Reply