Adailson Posted August 25, 2022 Posted August 25, 2022 Hi, I have a lisp routine that works fine in AutoCAD. However, when I run the same routine in ZWCAD, it seems that some characters turn into the "�" character. I believe it's because of UTF-8 encoding, but I couldn't understand where to fix this problem. An example of what I'm reporting is shown in the image below. "entidade" contains the DXF structure for an Block. The block name is "CABEÇALHO". When I retrieve the block name via lisp, it returns "CABE�ALHO". Thank you very much in advance! Quote
BIGAL Posted August 26, 2022 Posted August 26, 2022 When you look carefully at "CABEÇALHO" the Ç is an extended character, ie a alt+num so ZWcad is trying to display with possibly a font that does not have Ç as a character. Bricscad was OK. If there is a way of defining the font to be used for display in ZWcad then it may display correct. 1 1 1 Quote
Adailson Posted August 26, 2022 Author Posted August 26, 2022 Thank you very much, Bigal! Following your suggestion, I found the following option not in ZWCAD itself, but in Visual Studio (installed along with ZWCAD): File >> Preferences >> Settings >> Text Editor > Auto Guess Encoding I've checked on this option and the routine worked normally with the extended characters . In Visual Studio preferences there is even an option to change the encoding format from UTF-8 to another format, but it only worked by checking the option above. I just couldn't understand why a setting in Visual Studio affects the behavior of ZWCAD itself. I imagined that the two applications would be somewhat independent. I believe that on each machine I run the routine, I should check this option in Visual Studio. Again, thank you very much for your help! Quote
Steven P Posted August 26, 2022 Posted August 26, 2022 I know that this is cheating but can you call the block something different, without the extended characters? A quick fix but maybe not the best fix 1 Quote
mhupp Posted August 26, 2022 Posted August 26, 2022 Have a lisp that pulls names from existing text. it would error if it contained any windows illegal characters. so i have it automatically check and replace with this line. (setq blkname (vl-string-translate "<>:\"/\\|?*" " _ " blkname)) ;replace ileagel characters with space and / with _ If you can't change the default font in ZWcad like BIGAL said. maybe list all the illegal characters and translate them to something else/similar that can be dispalyed. 1 Quote
Adailson Posted August 26, 2022 Author Posted August 26, 2022 19 minutes ago, Steven P said: I know that this is cheating but can you call the block something different, without the extended characters? A quick fix but maybe not the best fix Hi Steve! It's an alternative. However, I don't just read the "block name" property, but I also read values that the user has entered into attribute fields. And as the language is Portuguese, even if I change the block name, the user can type texts in the attribute fields that contain these characters. Anyway, thanks for the suggestion. 1 Quote
Adailson Posted August 26, 2022 Author Posted August 26, 2022 3 minutes ago, mhupp said: Have a lisp that pulls names from existing text. it would error if it contained any windows illegal characters. so i have it automatically check and replace with this line. (setq blkname (vl-string-translate "<>:\"/\\|?*" " _ " blkname)) ;replace ileagel characters with space and / with _ If you can't change the default font in ZWcad like BIGAL said. maybe list all the illegal characters and translate them to something else/similar that can be dispalyed. Thanks for the suggestion, mhupp. I think it's better to work this way than to always have to change software settings. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.