Difference: 0LASubrConvertHtmlToText (1 vs. 2)

Revision 22019-07-10 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="FullAPIList"

.CONVERT HTML TO TEXT

Line: 22 to 22
  <HTML> is the HTML data you want converted (Required).
Changed:
<
<
This routine will first strip all HTML tags, then convert any HTML entites into their single byte equivalents, ie, ¶ becomes the paragraph symbol (chr(182)), etc. Entities that can't be converted will be changed to a space. The ISO-8859-15 encoding is used for converting the entities to single byte characters.
>
>
This routine will first convert any <br /> tags to chr(182), strip all remaining HTML tags, then convert any HTML entites into their ISO-8859-15 single byte equivalents, ie, ¶ becomes the paragraph symbol (chr(182)), etc. Entities that can't be converted will be changed to a space.
  If <text> is too small to contain the converted text, --- .CONVERT HTML TO TEXT will contain 'Data was truncated'.

Revision 12019-07-09 - JeanNeron

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="FullAPIList"

.CONVERT HTML TO TEXT

This subroutine converts a HTML field to plain APPX text. Release 5.5. & higher.


Usage:

      PASS         <text>                     FIELD            SHARE? Y
      PASS         <html>                     FIELD            SHARE? N
      GOSUB    --- .CONVERT HTML TO TEXT
      *        check for errors
      IF       --- .CONVERT HTML TO TEXT      NE

Description:

This subroutine converts a field containing HTML tags and encodings into plain APPX text. All parameters are required, if any are missing the subroutine will CANCEL.

<text> returns the converted HTML (Required). This must be PASSed with Share "Y" to return the value.

<HTML> is the HTML data you want converted (Required).

This routine will first strip all HTML tags, then convert any HTML entites into their single byte equivalents, ie, ¶ becomes the paragraph symbol (chr(182)), etc. Entities that can't be converted will be changed to a space. The ISO-8859-15 encoding is used for converting the entities to single byte characters.

If <text> is too small to contain the converted text, --- .CONVERT HTML TO TEXT will contain 'Data was truncated'.

Also see .CONVERT TEXT TO HTML

Comments:

Read what other users have said about this page or add your own comments.


<--/commentPlugin-->

-- JeanNeron - 2019-07-09

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback