vault/classes/Maikuolan/Demojibakefier.php
private function dropVariants(&$Arr)
    {
        if (isset($Arr['GB18030'], $Arr['GB2312'])) {
            unset($Arr['GB2312']);
        }
        if (isset($Arr['UCS-2']) && (isset($Arr['UTF-16BE']) || isset($Arr['UTF-16LE']))) {
            unset($Arr['UCS-2']);
        }
        if (isset($Arr['UCS-4']) && (isset($Arr['UTF-32BE']) || isset($Arr['UTF-32LE']))) {
            unset($Arr['UCS-4']);
        }
        if (
            isset($Arr['UTF-8']) ||
            isset($Arr['UTF-16BE']) ||
            isset($Arr['UTF-16LE']) ||
            isset($Arr['UCS-2']) ||
            isset($Arr['UTF-32BE']) ||
            isset($Arr['UTF-32LE']) ||
            isset($Arr['UCS-4']) ||
            isset($Arr['GB18030']) ||
            isset($Arr['GB2312']) ||
            isset($Arr['BIG5']) ||
            isset($Arr['SHIFT-JIS']) ||
            isset($Arr['JOHAB']) ||
            isset($Arr['UCS-4'])
        ) {
            foreach ($Arr as $Key => $Value) {
                if (!preg_match('~^(?:UTF|UCS|GB|BIG5|SHIFT-JIS|JOHAB)~', $Key)) {
                    unset($Arr[$Key]);
                }
            }
        }
    }
private function dropVariants(&$Arr)
    {
        if (isset($Arr['GB18030'], $Arr['GB2312'])) {
            unset($Arr['GB2312']);
        }
        if (isset($Arr['UCS-2']) && (isset($Arr['UTF-16BE']) || isset($Arr['UTF-16LE']))) {
            unset($Arr['UCS-2']);
        }
        if (isset($Arr['UCS-4']) && (isset($Arr['UTF-32BE']) || isset($Arr['UTF-32LE']))) {
            unset($Arr['UCS-4']);
        }
        if (
            isset($Arr['UTF-8']) ||
            isset($Arr['UTF-16BE']) ||
            isset($Arr['UTF-16LE']) ||
            isset($Arr['UCS-2']) ||
            isset($Arr['UTF-32BE']) ||
            isset($Arr['UTF-32LE']) ||
            isset($Arr['UCS-4']) ||
            isset($Arr['GB18030']) ||
            isset($Arr['GB2312']) ||
            isset($Arr['BIG5']) ||
            isset($Arr['SHIFT-JIS']) ||
            isset($Arr['JOHAB']) ||
            isset($Arr['UCS-4'])
        ) {
            foreach ($Arr as $Key => $Value) {
                if (!preg_match('~^(?:UTF|UCS|GB|BIG5|SHIFT-JIS|JOHAB)~', $Key)) {
                    unset($Arr[$Key]);
                }
            }
        }
    }
private function dropVariants ( & $ Arr ) { if ( isset ( $ Arr [ 'GB18030' ] , $ Arr [ 'GB2312' ] ) ) { unset ( $ Arr [ 'GB2312' ] ) ; } if ( isset ( $ Arr [ 'UCS-2' ] ) && ( isset ( $ Arr [ 'UTF-16BE' ] ) || isset ( $ Arr [ 'UTF-16LE' ] ) ) ) { unset ( $ Arr [ 'UCS-2' ] ) ; } if ( isset ( $ Arr [ 'UCS-4' ] ) && ( isset ( $ Arr [ 'UTF-32BE' ] ) || isset ( $ Arr [ 'UTF-32LE' ] ) ) ) { unset ( $ Arr [ 'UCS-4' ] ) ; } if ( isset ( $ Arr [ 'UTF-8' ] ) || isset ( $ Arr [ 'UTF-16BE' ] ) || isset ( $ Arr [ 'UTF-16LE' ] ) || isset ( $ Arr [ 'UCS-2' ] ) || isset ( $ Arr [ 'UTF-32BE' ] ) || isset ( $ Arr [ 'UTF-32LE' ] ) || isset ( $ Arr [ 'UCS-4' ] ) || isset ( $ Arr [ 'GB18030' ] ) || isset ( $ Arr [ 'GB2312' ] ) || isset ( $ Arr [ 'BIG5' ] ) || isset ( $ Arr [ 'SHIFT-JIS' ] ) || isset ( $ Arr [ 'JOHAB' ] ) || isset ( $ Arr [ 'UCS-4' ] ) ) { foreach ( $ Arr as $ Key => $ Value ) { if ( ! preg_match ( '~^(?:UTF|UCS|GB|BIG5|SHIFT-JIS|JOHAB)~' , $ Key ) ) { unset ( $ Arr [ $ Key ] ) ; } } } }
Drop candidates belonging to encodings that are outdated subsets or variants of other encodings with valid
candidates.

@param array $Arr An array of potential candidates.
@return array The input array, hopefully reduced, if possible.
Drop candidates belonging to encodings that are outdated subsets or variants of other encodings with valid candidates .