Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX messing up environment variables characters (language encoding problem?) 1

Status
Not open for further replies.

Andersen07

Industrial
Dec 8, 2021
28
I'm trying to set the [tt]UGII_ENV_FILE[/tt] environment variable to point to a [tt]ugii_env.dat[/tt] file located in the company's server.

The path to the file is: [tt]\\172.16.17.2\NX FILES\CONFIGURAÇÕES\ugii_env.dat[/tt]
As you can see, it contains special characters like whitespace, [tt]Ç[/tt] and [tt]Õ[/tt].

Then I go to Windows environment variables dialog and create a new system variable [tt]UGII_ENV_FILE=\\172.16.17.2\NX FILES\CONFIGURAÇÕES\ugii_env.dat[/tt]

When I start NX, I get the following error message:
[pre]
**************************************************************************
**************************************************************************
* This session had the following startup problems. *
**************************************************************************
**************************************************************************
File o:\nx2007\ip1700\src\syss\shar\ind\env.c: line 1082: ENV: Env file \\172.16.17.2\NX FILES\CONFIGURAÇÕES\ugii_env.dat could not be
loaded Environment file ugii_env.dat does not exist
[/pre]

Notice that instead of writing "[tt]CONFIGURAÇÕES[/tt]" in the file path, it wrote "[tt]CONFIGURAÇÕES[/tt]", meaning it didn't understand the characters.
Wasn't NX supposed to work with several languages?
I'd like to keep the folders with these names, if possible. Can someone help me please?

Edit: I figured NX is trying to read the path as if it were ANSI (Windows 1252) encoded, while it's actually UTF-8 BOM. How to fix?
 
Replies continue below

Recommended for you

Have you heard of Don Quixote ? :)
( the knight fighting windmills in belief these are giants, and well , he isn't winning the fight....)
that said, the only tip I might have is to enclose that string with " and ".
NX ( Unigraphics) was a Unix system, and in those days a "space" or non-ascii character in a file name of directory was an absolute taboo.
sometimes at least the "space" issue could be saved by using the "" to convince NX that this is a single string and not multiple. ( in Unix two words = two files)

Regards,
Tomas


 
Toost,
I tried your suggestion and enclosed the path string in "".

Didn't work. NX returned the same error as before.

[pre]
**************************************************************************
**************************************************************************
* This session had the following startup problems. *
**************************************************************************
**************************************************************************
File o:\nx2007\ip1700\src\syss\shar\ind\env.c: line 1082: ENV: Env file "\\172.16.17.2\NX FILES\CONFIGURAÇÕES\ugii_env.dat" could not be
loaded Environment file ugii_env.dat does not exist
[/pre]

I think the whitespace was never the issue. It's actually struggling with the Ç and Õ characters.

The company I work at has a policy on correctly writing the folders and file names with all of the accents (`, ´, ç, ~, ^) and everything according to the brazillian portuguese language. I didn't want to "break the rules" by writing "CONFIGURACOES" instead only for NX to work. Isn't there anything that can be done?
 
One can, ( do not ask me how... ) define aliases in Windows, if that would work or solve this issue is ... ?


Regards,
Tomas
 
Toost,
tried it, no luck.

Hope NX can fix this issue soon, for better internationalization
 
Fixed the problem on my own
Thanks for the help.

What I did:
Instead of using the [tt]UGII_ENV_FILE[/tt] system environment variable, I used the default [tt]ugii_env.dat[/tt] file located in the default NX install folder ([tt]%UGII_BASE_DIR%\UGII\ugii_env.dat[/tt]) and added an [tt]#include[/tt] clause in it pointing to the network file in my company's server. Both the files ([tt]ugii_env.dat[/tt] in the local install folder and in the company's server) MUST be saved with ANSI (Windows-1252) encoding for this to work, as it seems NX doesn't understand UTF-8 or any other encoding for this file (funny thing is that this file's default encoding is UTF-8, but it doesn't work with special characters).

DO NOT use the [tt]UGII_ENV_FILE[/tt] variable if you want NX to recognize special characters!
[ol 1]
[li]Added [tt]#include "\\172.16.17.2\NX FILES\CONFIGURAÇÕES\ugii_env.dat"[/tt] to the local [tt]ugii_env.dat[/tt] file (located at [tt]%UGII_BASE_DIR%\UGII\ugii_env.dat[/tt]). Notice the double quotes[/li]
[li]Saved it with ANSI (Windows-1252) encoding[/li]
[li]Edited the network shared file ([tt]\\172.16.17.2\NX FILES\CONFIGURAÇÕES\ugii_env.dat[/tt]) according to my company needs and saved it with ANSI (Windows-1252) encoding as well[/li]
[li]Restarted NX. It now recognizes the special characters and everything works as expected[/li]
[/ol]

 
Thanks for the update ! It will be good to have this as a reference.

Jerry J.
UGV5-NX1961
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor