Consultor Eletrônico



Kbase P158898: Error 2918 is shown in the WebSpeed server log file when used replace function to replace chr(160)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   20/01/2010
Status: Unverified

SYMPTOM(s):

Error 2918 is shown in the WebSpeed server log file when used replace function to replace chr(160)

Second parameter of REPLACE must have non-zero length. (2918)

FACT(s) (Environment):

Example code run on the scripting lab on the workshop:

DEF VAR astring AS CHAR NO-UNDO.
astring = "foo" + CHR(160) + "bar".
{&out} astring '<br>'.
astring = REPLACE(astring,chr(160),"").
{&out} astring '<br>'.

When used ASC(CHR(160)), it displayed -1 instead of 160

When used ASC(CHR(10)), it displayed 10 as expected
Only one machine causes the WebSpeed agent to fail when used the above example code
The %DLC%\startup.pf file shows both -cpstream and -cpinternal value set to utf-8
Working machines have the -cpstream and -cpinternal value set to iso8859-1 in the %DLC%\startup.pf file
All Supported Operating Systems
OpenEdge 10.x

CAUSE:

The -cpstream and -cpinternal value set to utf-8 in the %DLC%\startup.pf file caused the WebSpeed agent to cause the error. By default ABL, WebSpeed and AppServer client will pickup the %DLC%\startup.pf file for -cpstream and -cpinternal parameters. These parameter can be specified on the ABL, WebSpeed and AppServer client's parameter which override the default parameters in the %DLC%\startup.pf file

FIX:

There are two workarounds:

1. Add the -cpstream and -cpinternal parameters to iso8859-1 on the connection parameter, and restart the broker, or trim all the agents so new agents will start with iso8859-1 character set

Or,

2. Modify %DLC%\startup.pf file and change the value of -cpstream and -cpinternal to iso8859-1, and restart the broker, or trim all the agents so new agents will start with iso8859-1 character set