4D v13.4

Convert to text

Home

 
4D v13.4
Convert to text

Convert to text 


 

Convert to text ( blob ; charSet ) -> Function result 
Parameter Type   Description
blob  BLOB in BLOB containing text expressed in a specific character set
charSet  String, Longint in Name or Number of BLOB character set
Function result  Text in Contents of BLOB expressed in 4D character set

The Convert to text command converts the text contained in the blob parameter and returns it in text expressed in the character set of 4D. In version 11, 4D uses the Unicode character set by default.

In charSet, pass the character set of the text contained in blob, which will be used for the conversion. You can pass a string providing the standard name of the character set, or one of its aliases (for example, “ISO-8859-1” or “UTF-8”), or its identifier (longint). For more information, please refer to the description of the CONVERT FROM TEXT command.

Convert to text supports Byte Order Marks (BOMs). If the character set specified is of the Unicode type (UTF-8, UTF-16 or UTF-32), 4D attempts to identify a BOM among the first bytes received. If one is detected, it is filtered out of the result and 4D uses the character set that it defines instead of the one specified.

Note: This command only works when 4D is executed in Unicode mode (the Unicode option must be checked in the 4D Preferences, see the “ASCII Codes” section). If it is used in compatibility mode (non-Unicode), it returns an empty string and the OK variable is set to 0.

If the command has been correctly executed, the OK variable is set to 1. Otherwise, it is set to 0.

 
PROPERTIES 

Product: 4D
Theme: String
Number: 1012

The OK variable is changed by the commandThe Unicode mode affects this command

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D v11 SQL
Modified: 4D v12

 
SEE ALSO 

CONVERT FROM TEXT

 
TAGS 

BOM***