Provided are a method, system and program for translating a source character
string in a first character encoding into a target character string in a second
character encoding. A plurality of specifications are maintained. Each specification
has one of a plurality of scopes identifying at least one code page providing a
mapping for source character strings in the first character encoding. The scopes
specify different portions of the program to which the code page identified by
the specification applies. The source character string for which translation is
requested in the program is processed and a determination is made of one specification
having one scope that is applicable to the processed source character string. The
code page identified by the determined specification is used to translate the processed
source character string in the first character encoding into the target character
string in the second character encoding.