BBjJettyContextConfiguration::setEncoding


Description

In BBj 15.0 and higher, this method sets the encoding for the current Context

Syntax

Return Value

Method

void

setEncoding(string encoding)

Parameters

Variable

Description

encoding

the encoding for the context

Return Value

None.

Remarks

Examples of encoding are 'ISO 8859-1' and 'UTF-8'

Example

rem '=== THIS PROGRAM SWAPS THE ENCODING BETWEEB "UTF-8" AND "UTF-16" ===

declare BBjAPI api!
declare BBjAdmin admin!
declare BBjJettyServerConfiguration config!
declare BBjJettyContextConfiguration root!
api! = BBJAPI()
admin! = api!.getAdmin("admin","admin123")
config! = admin!.getJettyServerConfig()
root! = config!.getRootContextInfo()
old$ = str(root!.getEncoding())
print "Old Encoding = " + old$
if (old$="UTF-8") then
    root!.setEncoding("UTF-16")
else
    root!.setEncoding("UTF-8")
endif
config!.saveConfig()

See Also

BBjAPI

BBjJettyContextConfiguration