code2utf

The Gravity PDF code2utf function.

Description

code2utf( $num, (constant) $lo = true ); 

Parameters (2)

0. $num
The num.
1. $lo — Optional. (constant) => true
The lo.

Usage

  1. if ( !function_exists( 'code2utf' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-pdf/vendor/blueliquiddesigns/mpdf/includes/functions.php'; 
  3.  
  4. // The num. 
  5. $num = null; 
  6.  
  7. // The lo. 
  8. $lo = true; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = code2utf($num, $lo); 
  12.  

Defined (1)

The function is defined in the following location(s).

/vendor/blueliquiddesigns/mpdf/includes/functions.php  
  1. function code2utf($num, $lo=true) { 
  2. //Returns the utf string corresponding to the unicode value 
  3. if ($num<128) { 
  4. if ($lo) return chr($num); 
  5. else return '&#'.$num.';'; 
  6. if ($num<2048) return chr(($num>>6)+192).chr(($num&63)+128); 
  7. if ($num<65536) return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128); 
  8. if ($num<2097152) return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128); 
  9. return '?';