swenc utility

The swenc command enables you to switch the character encoding within a Global Shell session.

swenc syntax

The swenc command has the following syntax:

swenc [-e encoding] [-T {on | off}] [-E] [-x] [-c command]

The following table describes the swenc options.

Swenc options

Option

Description

-c command

Executes command  and exits, reverting the session encoding to its previous state.

-E

Lists the valid character encodings.

-e encoding

Changes the character encoding of the current session.

-T {on | off}

Turns on or off the transcoding of data from the UNIX managed server. (Data from Windows servers does not need to be transcoded.) See Transcoded data in a managed server.

-x

Prevents the launching of a sub-shell.

swenc usage rules

The following usage rules apply to the swenc utility:

If you specify no options, swenc displays the character encoding and transcoding mode of the current session.

Unless you specify the -x option, swenc starts a new sub-shell, which uses the encoding specified with the -e option. To leave the sub-shell and revert to the previous encoding, enter exit.

Changing the encoding with swenc affects all processes in the current session, including background processes. If you change the encoding while background processes are running, the background processes might encounter errors.

The swenc command affects only the current Global Shell session. For example, if you run the rosh command after the swenc-e command, the rosh command does not inherit the encoding that you changed with the swenc command.

The swenc command does not change the working directory of the session, unless the working directory contains path names that cannot be represented in the new encoding. In this case, the working directory is the user’s home directory.

If you change the character encoding, make sure that the encoding of the terminal application that hosts the Global Shell and Remote Terminal sessions is set properly. To view or change the terminal client, go to the Terminal and Shell Preferences of the SA Client.