BBjJettyContextConfiguration::getEncoding

Description

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

Syntax

Return Value

Method

String

getEncoding()

Parameters

None.

Return Value

the current encoding for the context

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