docs.intersystems.com
InterSystems IRIS Data Platform 2019.2  /  ObjectScript Reference

ObjectScript Reference
$WISWIDE
Previous section           Next section
InterSystems: The power behind what matters   
Search:  


Returns a flag indicating whether a string contains surrogate pairs.
Synopsis
$WISWIDE(string)
Parameter
string A string or expression that evaluates to a string.
Description
$WISWIDE returns a boolean value indicating whether string contains surrogate pairs. 0=string does not contain any surrogate pairs. 1=string contains one or more surrogate pairs.
A surrogate pair is a pair of 16-bit InterSystems IRIS character elements that together encode a single Unicode character. Surrogate pairs are used to represent certain ideographs which are used in Chinese, Japanese kanji, and Korean hanja. (Most commonly-used Chinese, kanji, and hanja characters are represented by standard 16-bit Unicode encodings.) Surrogate pairs provide InterSystems IRIS support for the Japanese JIS X0213:2004 (JIS2004) encoding standard and the Chinese GB18030 encoding standard.
A surrogate pair consists of high-order 16-bit character element in the hexadecimal range D800 through DBFF, and a low-order 16-bit character element in the hexadecimal range DC00 through DFFF.
Example
The following example shows $WISWIDE returning a boolean for a surrogate pair:
  SET spair=$CHAR($ZHEX("D806"),$ZHEX("DC06")) /* surrogate pair */
  SET xpair=$CHAR($ZHEX("DC06"),$ZHEX("D806")) /* NOT a surrogate pair */
  SET str="AB"_spair_"CD"
  WRITE !,$WISWIDE(str)," = surrogate pair(s) in string?"
  SET xstr="AB"_xpair_"CD"
  WRITE !,$WISWIDE(xstr)," = surrogate pair(s) in string?"
See Also


Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-08-23 05:35:26