PreviousNextIndex

CODEPAGE-CONVERT function

Converts a string value from one code page to another.

Syntax

CODEPAGE-CONVERT 
  ( source-string 
    [ , target-codepage [ , source-codepage ] ] 
  ) 

source-string
target-codepage
source-codepage
Example

This example assumes that the native code page of r-codpag.p is ibm850. It is written so that its embedded text strings are always converted to the internal code page of the ABL session (SESSION:CHARSET).

r-codpag.p
DEFINE VARIABLE cp850string   AS CHARACTER NO-UNDO 
  INITIAL "text with umlaut (ä)". 
DEFINE VARIABLE charsetstring AS CHARACTER NO-UNDO. 
charsetstring = CODEPAGE-CONVERT(cp850string, SESSION:CHARSET, "ibm850"). 
FOR EACH Item NO-LOCK: 
  IF LOOKUP(charsetstring, Item.CatDescription) > 0 THEN 
    DISPLAY Item.ItemName. 
END. 

Notes
See also

ASC function, CHR function, STRING function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex