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

Bug when loading text encoding #200

Closed
batata004 opened this issue Aug 30, 2017 · 4 comments
Closed

Bug when loading text encoding #200

batata004 opened this issue Aug 30, 2017 · 4 comments

Comments

@batata004
Copy link

Hi,

I tried changing the config.php file to set a default encoding that kodexplorer should use when it opens a file in the file editor but it does not look to work.

You can reproduce this bug easily: set your desired encoding at the very beginning of the string in the config.php file. Even setting your default encoding there kodexplorer will not honor that.

@batata004
Copy link
Author

I am debugging some files and I think I should change something in editor.class.php probably in this line:

```
if ($charset !='' &&
		$charset !='utf-8' &&
		function_exists("mb_convert_encoding")
		){
		$fileContents = @mb_convert_encoding($fileContents,'utf-8',$charset);
	}

But I have no idea how to add my chart set there cp 1252

@batata004
Copy link
Author

I just tried the code below, it looks kodexplorer is reading the file differently but still some characters are missing:

```
if ($charset !='' &&
		$charset !='utf-8' &&
		function_exists("mb_convert_encoding")
		){
		$fileContents = @mb_convert_encoding($fileContents,'cp1252',$charset);
	}

@batata004
Copy link
Author

I dont know it this helps you to convert CP1252 -> https://stackoverflow.com/questions/22683132/php-cp1252-windows-1252-conversion-to-utf-8

@kalcaddle
Copy link
Owner

Repeat: this not kodexplorer's bug,

There are some coding areas that are basically overlapping,
and the system can't tell what charset it is

Please use utf-8!!!!

charset get at:
https://github.com/kalcaddle/KodExplorer/blob/master/app/function/helper.function.php#L119-L172

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

2 participants