As follows: CodeThe length of two-byte characters can be calculated.
Copy codeThe Code is as follows :/**
* <P> host performance: the number of inner nodes in the queue reaches the maximum number of nodes in the queue. </P>
* <P> Summary: </P>
* <Ol>
* <Li> </LI>
* </OL>
* @ Param string
* @ Return int
*/
Private function getstractuallen (schars: string): int {
Return schars. Replace (/[^ \ x00-\ xFF]/g, "XX"). length;
}
/**
* <P> host performance: the number of inner nodes in the queue reaches the maximum number of nodes in the queue. </P>
* <P> Summary: </P>
* <Ol>
* <Li> </LI>
* </OL>
* @ Param string
* @ Return int
*/
Private function getstractuallen (schars: string): int {
Return schars. Replace (/[^ \ x00-\ xFF]/g, "XX"). length;
}
In this way, you can determine the length of the string uploaded from the page for necessary checks.