Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different OS local file system path encoding #12

Open
liaosankai opened this issue Jan 12, 2014 · 0 comments
Open

Different OS local file system path encoding #12

liaosankai opened this issue Jan 12, 2014 · 0 comments

Comments

@liaosankai
Copy link

How about add charset param for different OS local file system path character encode?

Add new param to kohana-storage\config\storage.php

// REQUIRED - OS file system path default encoding
$config['local']['charset'] = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
? "ASCII" : "UTF-8";

Add function to kohana-storage\classes\Storage\Connection\Local.php

/**
 * Convert path string to requested character encoding
 *
 * @access  protected
 * @param   string $path path without encoding
 * @return  string
 */
protected function _iconv_path($path)
{
    return = iconv("UTF-8", "{$this->_config['charset']}//IGNORE", $path);
}

and add $path = $this->_iconv_path($path); to first line on per function with $path param.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant