Wrong encoding from parameters

Wrong encoding from parameters

Anonymous
Not applicable
488 Views
1 Reply
Message 1 of 2

Wrong encoding from parameters

Anonymous
Not applicable

Hi,

if document Author or whatever global parameter contains unicode chars "ěščřžýáíé...." function 

getGlobalParameter("inventor:Author") returns mismatch string:
 
CPS encoding is set to setCodePage("utf-8");
 
Author: ěščřžýáíé
 
writeln(getGlobalParameter("inventor:Author"));
returns in HSM Edit "=> ۛá¡ÍÙ™þ¾ý½á¡í­é©."
if opened in utf-8 editor, because HSM Edit doesn't show UTF-8 chars  (in 2019?)
returns "Û›á¡ÍÙ™þ¾ý½á¡í­é©"
 
text = getGlobalParameter("inventor:Author");
for (var i = 0; i < text.length; ++i) writeln(text.charCodeAt(i));
returns "219, 155, 225, 161, 205, 141, 217, 153, 254, 190, 253, 189, 225, 161, 237, 173, 233, 169"
 
 Is it bug or i missed something ?
0 Likes
489 Views
1 Reply
Reply (1)
Message 2 of 2

makko74
Collaborator
Collaborator

Hi, have the same problem with German umlauts (äÄöÖüÜß / codepage: 1252), I've written to this a small translation function in the post processer, to get it work.

It only affects the global parameters which start with "inventor:", the rest works as it should.

 

Mario

 



InfoInventor CAM(Ultimate) user --- Inventor Professional 2021.2 + Inventor CAM Ultimate 8.1.2.21785
0 Likes