public function testChr() { $this->assertEquals('A', Text::chr(65)); $this->assertEquals('A', Text::chr(0x41)); $this->assertEquals('é', Text::chr(233)); $this->assertEquals('é', Text::chr(0xe9)); $this->assertEquals('⼳', Text::chr(12083)); $this->assertEquals('⼳', Text::chr(0x2f33)); $this->assertEquals('🌃', Text::chr(127747)); $this->assertEquals('🌃', Text::chr(0x1f303)); $this->assertEquals('', Text::chr(2097152)); }
/** * An atom record that specifies the name of a slide. * @param string $stream * @param integer $pos * @link https://msdn.microsoft.com/en-us/library/dd906297(v=office.12).aspx */ private function readRecordSlideNameAtom($stream, $pos) { $arrayReturn = array('length' => 0, 'slideName' => ''); $data = $this->loadRecordHeader($stream, $pos); if ($data['recVer'] == 0x0 && $data['recInstance'] == 0x3 && $data['recType'] == self::RT_CSTRING && $data['recLen'] % 2 == 0) { // Record Header $arrayReturn['length'] += 8; // Length $strLen = $data['recLen'] / 2; for ($inc = 0; $inc < $strLen; $inc++) { $char = self::getInt2d($stream, $pos + $arrayReturn['length']); $arrayReturn['length'] += 2; $arrayReturn['slideName'] .= Text::chr($char); } } return $arrayReturn; }