TextEncodingNameLookup example

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;
            $parsedFrame['encoding']    = $this->TextEncodingNameLookup($frame_textencoding);

            $parsedFrame['description'] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding']$info['id3v2']['encoding']$parsedFrame['description']));
            $parsedFrame['data'] = substr($parsedFrame['data']$frame_terminatorpos + strlen($frame_textencoding_terminator));
            $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data']$frame_textencoding_terminator);
            if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
                $commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0));
                if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey$info['id3v2']['comments'][$parsedFrame['framenameshort']])) {
                    $info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding']$info['id3v2']['encoding']$parsedFrame['data']));
                } else {
                    $info['id3v2']['comments'][$parsedFrame['framenameshort']][]            = trim(getid3_lib::iconv_fallback($parsedFrame['encoding']$info['id3v2']['encoding']$parsedFrame['data']));
                }
            }
Home | Imprint | This part of the site doesn't use cookies.