Post Unable to Read Japanese

Post Unable to Read Japanese

jrobersonJE6HW
Enthusiast Enthusiast
1,040 Views
10 Replies
Message 1 of 11

Post Unable to Read Japanese

jrobersonJE6HW
Enthusiast
Enthusiast

Good day.

I noticed that Fusion post cannot read "operation-comment" if they are in Japanese. 

I used Fusion in Japanese. And if I change all the toolpath names to English then it are given out in the post as usual.

If Japanese I get question marks or blanks instead. I know that there is operation-strategy, editting the post to say this versus the operation-comment will give out the english name without having to edit every single name of every toolpath in my CAM program. But I would really like to be able to included the Japanese names. 

The technical works in English are not well know by my users and has made it difficult to keep track of NC data as easily.

 

Any help with this? I currently code in SJIS as that is the only way to read the Japanese notes and characters. But if there a work around for getting the "operation-comment" to come out?

 

※No special post being editted, just standard OKUMA/FANUC posts.

 

See attached images. For example 2Dポケット(2) 2 gets turned into (2D 2 2). If english then no issues.

Then just the dump file showing the Japanese release.

 

Thanks for your time.

0 Likes
Accepted solutions (1)
1,041 Views
10 Replies
Replies (10)
Message 2 of 11

seth.madore
Community Manager
Community Manager

I think it has something to do with ‘permittedCommentChars’ which defines what characters are permitted in the comments and other fields. You may have to add your alphabet to the permitted list

 


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 3 of 11

jrobersonJE6HW
Enthusiast
Enthusiast

Thank you for you reply. But I also tried this. This just gives me ??? marks as well. This was actually the first thing I thought of. I tried adding the alphabet characters in the permittedcharacters section copy and pasted directly from the dumb file, or even tried out normally. Neither worked.

0 Likes
Message 4 of 11

jrobersonJE6HW
Enthusiast
Enthusiast

I even tried doing it this way, as you can see, it still doesn't give the Japanese. 

I'm pretty sure it has something to do with the way the Post Processes the data, probably as a UTF8/16 files therefore cannot translate the Japanese. 

Is there a way to force the post processor to read the data as SJIS instead of UTF8/16?

0 Likes
Message 5 of 11

jrobersonJE6HW
Enthusiast
Enthusiast

Sorry for the 3rd reply, but as you can see, even if I add the exact japanese as written below in the permitted characters section I get question marks. Meaning the data is being read in a UTF8 form, I believe.

0 Likes
Message 6 of 11

Laurens-3DTechDraw
Mentor
Mentor
setCodePage("ascii");

Every post indeed sets the encoding.

Check what yours sets, maybe changing this will help?

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Message 7 of 11

kandennti
Mentor
Mentor
Accepted solution

Thank you, @Laurens-3DTechDraw .

 

I changed "setCodePage" like this.

// setCodePage("ascii");
setCodePage("Shift_JIS");

 

After post-processing, the finished NC program is opened in VSCode, and when I switch the VSCode encoding to the same "Shift_JIS", the program is displayed correctly.

1.png

Since it is troublesome to switch the VSCode encoding every time, it is convenient to set the encoding by extension in advance.

https://note.affi-sapo-sv.com/vscode-save-encode-change.php#:~:text=%E8%A6%8F%E5%AE%9A%E3%81%AE%E6%9... 

 

In addition, I had thought that it was impossible to use Japanese characters in CPS files for many years because of an error during post-processing, but now I know that it is possible to display Japanese characters in post-processing properties.

・Open CPS file with VSCode
・Switch to the desired encoding
・Rewrite necessary characters into Japanese
・Save the file.

 

 

1.png

 

Perhaps this is effective not only for Japanese, but also for languages that use 2-byte characters.

Message 8 of 11

jrobersonJE6HW
Enthusiast
Enthusiast

Thank you for your reply. Actually, I've already tried this.
While yes, I can see the Japanese in the post properties within Fusion. I can't get it to read the toolpath names in Japanese and write them as comments in the post as proper Japanese. Even now I still get errors.

This edit also done with an otherwise uneditted copy from the post library (just to prove that this is occuring without any other edits).

0 Likes
Message 9 of 11

jrobersonJE6HW
Enthusiast
Enthusiast
Well, actually, I tested this by actually throwing at out a post from Fusion with the setCodePage changed to Shift_JIS which actually gives me the correct Japanese, however, VSCode always gives me the above strange codes. But... hey I can live with that. Thank you.
0 Likes
Message 10 of 11

kandennti
Mentor
Mentor

@jrobersonJE6HW .

 

I think the garbled characters are due to the different encoding.

Wouldn't the NC program after post-processing also display correctly if the encoding is the same as when the CPS file was edited?

0 Likes
Message 11 of 11

jrobersonJE6HW
Enthusiast
Enthusiast
I think because the Autodesk Library "export CNC to VS Code" file is most likely set in "ascii" it causes errors when trying to check coding through the debugging extension in VSCode. But when I use the post and actually process it to spit out NC data, it comes out in Japanese just fine. I don't usually go through Fusion to push out a code with a post processor until the debugger gives me decent results. I assumed the garbled letters where the code not working when I tried this previously on my own.
0 Likes