bstrclean(X)

Returns a boolean value indicating whether the given string is plain (7-bit) ASCII (i.e., "8-bit clean").

Syntax

bstrclean(X)

Input

Argument Type Description
X text The string on which to apply the function

A scalar value or the name of a column

Return Value

Returns an integer value of 1 if every character in the string X has a byte value less than 128 (i.e., can be represented in 7-bit ASCII); otherwise, it returns 0.

If X is N/A, the result is 1.

Sample Usage

value bstrclean(value)
'banana' 1
'琵琶' 0
'' 1
<arbitrary binary string with non-UTF-8 character sequences> 0

Additional Information

  • The related function strclean(X) checks whether a string is legal UTF-8 Unicode.