src/acdhOeaw/schema/file/File.php
static private function detectPathEncoding() {
        if (self::$pathEncoding) {
            return;
        }
        foreach (explode(';', setlocale(LC_ALL, 0)) as $i) {
            $i = explode('=', $i);
            if ($i[0] === 'LC_CTYPE') {
                $tmp = preg_replace('|^.*[.]|', '', $i[1]);
                if (is_numeric($tmp)) {
                    self::$pathEncoding = 'windows-' . $tmp;
                    break;
                } else if (preg_match('|utf-?8|i', $tmp)) {
                    self::$pathEncoding = 'utf-8';
                    break;
                } else {
                    throw new RuntimeException('Operation system encoding can not be determined');
                }
            }
        }
    }
static private function detectPathEncoding() {
        if (self::$pathEncoding) {
            return;
        }
        foreach (explode(';', setlocale(LC_ALL, 0)) as $i) {
            $i = explode('=', $i);
            if ($i[0] === 'LC_CTYPE') {
                $tmp = preg_replace('|^.*[.]|', '', $i[1]);
                if (is_numeric($tmp)) {
                    self::$pathEncoding = 'windows-' . $tmp;
                    break;
                } else if (preg_match('|utf-?8|i', $tmp)) {
                    self::$pathEncoding = 'utf-8';
                    break;
                } else {
                    throw new RuntimeException('Operation system encoding can not be determined');
                }
            }
        }
    }
static private function detectPathEncoding ( ) { if ( self :: $ pathEncoding ) { return ; } foreach ( explode ( ';' , setlocale ( LC_ALL , 0 ) ) as $ i ) { $ i = explode ( '=' , $ i ) ; if ( $ i [ 0 ] === 'LC_CTYPE' ) { $ tmp = preg_replace ( '|^.*[.]|' , '' , $ i [ 1 ] ) ; if ( is_numeric ( $ tmp ) ) { self :: $ pathEncoding = 'windows-' . $ tmp ; break ; } else if ( preg_match ( '|utf-?8|i' , $ tmp ) ) { self :: $ pathEncoding = 'utf-8' ; break ; } else { throw new RuntimeException ( 'Operation system encoding can not be determined' ) ; } } } }
Tries to detect path encoding used in the operating system by looking
into locale settings.
@throws RuntimeException
Tries to detect path encoding used in the operating system by looking into locale settings .