SetEncoding Function

Action

Sets a codepage, which is used by the functions FromEncoding and ToEncoding, to convert the given strings.

Include file

Kernel.bdh

Syntax

SetEncoding( in sCodepage: string ): boolean;

Return value

  • true if the codepage could be set.

  • false otherwise

Parameter Description
sCodepage The name of the used codepage. E.g.: "UTF-8", "WINDOWS-1255", "EUC-JP"

Example

dcltrans
  transaction TMain
  var
    sResult : string;
  begin
    SetEncoding("UTF-8");
    WebPageUrl("http://testsite.company.com.cn");
    WebParseHtmlBound(sResult, STRING_COMPLETE, "Home", "Street");
    WebPageLink(ToEncoding("画像"), "画像 - Company  検索");
    writeln(FromEncoding(sResult));
    writeln("http://testsite.company.com.cn has the codepage "  + GetEncoding() + " set");
  end TMain;