在delphi中怎样对字符串进行urlencode编码? 急!!!!!!!(20分)

  • 主题发起人 主题发起人 rzxiaojun
  • 开始时间 开始时间
HTTPEncode function

Converts a string into a form that contains no values that are illegal in an HTTP message header.

Unit

Httpapp

Category

HTTP utilities

function HTTPEncode(const AStr: String): string;

Description

HTTPEncode converts all characters in the AStr parameter except for the letters A through Z (and a through z), numerals 0 through 9, the asterisk (*), dollar sign ($), exclamation point (!), at sign (@), period (.), underscore (_), single quote (?, comma (,) parentheses, and hyphen (-). Spaces are converted to plus characters (+), and all other characters are converted into hex values preceded by the percent sign (%).

For example, the string

% ?

is converted into

%%+%3f

HTTPEncode returns the converted string.
 
接受答案了.
 
后退
顶部