VMware Cloud Community
shaka
Enthusiast
Enthusiast
Jump to solution

setting default language in script

When running a perl script to create a VM in vCenter the script fails due to the default language set in vCenter and/or the vCLI. The default langauge set is to something other than Englisgh and the script has been written in english so the script does not run. How can I set the default language in the script to English? Any ideas?

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Per the vCLI documentation you can use:

--encoding <encoding>
VI_ENCODING=<encoding>
Specifies the encoding to be used. One of cp936 (Simplified Chinese) ISO-8859-1
(German), or Shift_JIS (Japanese).
You can use --encoding to specify the encoding the vSphere CLI should map to
when it is run on a foreign language system.

If that works, you can create a configuration file and just add the entry VI_ENCODING="" and that will be permanent each time you call any vCLI or vSphere SDK for Perl scripts.

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
2 Replies
lamw
Community Manager
Community Manager
Jump to solution

Per the vCLI documentation you can use:

--encoding <encoding>
VI_ENCODING=<encoding>
Specifies the encoding to be used. One of cp936 (Simplified Chinese) ISO-8859-1
(German), or Shift_JIS (Japanese).
You can use --encoding to specify the encoding the vSphere CLI should map to
when it is run on a foreign language system.

If that works, you can create a configuration file and just add the entry VI_ENCODING="" and that will be permanent each time you call any vCLI or vSphere SDK for Perl scripts.

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
shaka
Enthusiast
Enthusiast
Jump to solution

Thanks found the same answer as your email came through Smiley Happy

0 Kudos