TextEncodingTerminatorLookup example

 elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'TXXX')) || // 4.2.2 TXXX User defined text information frame                 (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'TXX'))) {    // 4.2.2 TXX User defined text information frame             // There may be more than one 'TXXX' frame in each tag,             // but only one with the same description.             // <Header for 'User defined text information frame', ID: 'TXXX'>             // Text encoding $xx             // Description <text string according to encoding> $00 (00)             // Value <text string according to encoding>
            $frame_offset = 0;
            $frame_textencoding = ord(substr($parsedFrame['data']$frame_offset++, 1));
            $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
            if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
                $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding');
                $frame_textencoding_terminator = "\x00";
            }
            $frame_terminatorpos = strpos($parsedFrame['data']$frame_textencoding_terminator$frame_offset);
            if (ord(substr($parsedFrame['data']$frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
                $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00             }
            $parsedFrame['description'] = substr($parsedFrame['data']$frame_offset$frame_terminatorpos - $frame_offset);
            $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);
            $parsedFrame['encodingid']  = $frame_textencoding;
            
Home | Imprint | This part of the site doesn't use cookies.