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

ArgumentError: invalid byte sequence in UTF-8 Use --trace for backtrace #696

Open
zbin1988 opened this issue Oct 30, 2017 · 16 comments
Open

Comments

@zbin1988
Copy link

Koala version

Bug report or feature request?

@boyum
Copy link

boyum commented Nov 2, 2017

Save your files with UTF-8 encoding for now. Koala probably should support ISO-1252 and similar as well.

@TorvaldC
Copy link

TorvaldC commented Jan 7, 2018

I have just created new file "main.sass". I open it in Koala and it immediately shows me this message: ArgumentError: invalid byte sequence in UTF-8 Use --trace for backtrace. What's wrong with it?

@boyum
Copy link

boyum commented Jan 7, 2018

What encoding are you using? Both for main.sass and its references.

@TorvaldC
Copy link

TorvaldC commented Jan 8, 2018

I just created two folders, SASS and CSS, and in SASS folder I created usual *.txt file and renamed it in main.sass, the file is empty, without any code. I open Koala, drag my SASS folder into, and immediately the error appears - "Save your files with UTF-8 encoding for now. Koala probably should support ISO-1252"
Interestingly, when I create file and name it with an extension "less", for example "main.less", empty file, and do the same action, drag and drop it into Koala, there is no any mistakes. It successfully works converting my less code into css. So what's wrong with sass extension?

@zaygraveyard
Copy link
Collaborator

@TorvaldC That's because this problem happens only with the SASS compiler.
BTW Does the path to the sass file contain any non-ASCII characters?

@TorvaldC
Copy link

TorvaldC commented Jan 8, 2018

Sorry, the text of error in previous post is different it is - ArgumentError: invalid byte sequence in UTF-8 Use --trace for backtrace

@TorvaldC
Copy link

TorvaldC commented Jan 8, 2018

No. I am aware of it can cause incorrect work of the program. So I always check the path to the file. But previously I worked only with less, and there were no problems at all. Yesterday I decided to try sass, and faced this problem.

@joaopedroraldi
Copy link

This problem is, probably, because you have any non utf-8 chars in your "C:/user/[name]"
I'm changing mine now to test.

@BataLaSalade
Copy link

I had the same problem. I just solved it, changing my folder name, i used accent é... without it, it works :)

@DenisCherniatev
Copy link

If you don't want to change you home folder name, try this:

  1. Shut down the Koala. Move USER_HOME/.koala to C:/Users/Default/docker/.koala
    use any path that is free of non ASCII chars.

  2. in file C:\Program Files (x86)\Koala\app\scripts\FileManager.js

replace:
exports.userDataDir = path.join(process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'], (process.platform === 'darwin') ? 'Library/Application Support/Koala/UserData' :'.koala');

with:
exports.userDataDir = 'C:/Users/Default/docker/.koala';

  1. in file C:\Program Files (x86)\Koala\app\scripts\pages\log.js

replace:
var errorLog = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'] + '/.koala/error.log';

with:
var errorLog = 'C:/Users/Default/docker/.koala/error.log';

@Sibil70
Copy link

Sibil70 commented Jul 27, 2018

another way I solved this trouble for russian language system and russian user name:
open windows control panel
1- find region & language;
2 - administrative language params;
3 - change system language;
4 - mark checkbox Use unicode (UTF-8);
5- reboot
6 - enjoy your coding!
898e995ca0

p.s. soory for my language, i m just lerning)

@Maximillliano
Copy link

another way I solved this trouble for russian language system and russian user name:
open windows control panel
1- find region & language;
2 - administrative language params;
3 - change system language;
4 - mark checkbox Use unicode (UTF-8);
5- reboot
6 - enjoy your coding!
898e995ca0

p.s. soory for my language, i m just lerning)

Thanks! Worked for me great

@itletu
Copy link

itletu commented Dec 11, 2018

如果您不想更改主文件夹名称,请尝试以下操作:

  1. 关闭考拉。将USER_HOME / .koala移动到C:/Users/Default/docker/.koala
    使用任何没有非ASCII字符的路径。
  2. 在文件C:\ Program Files(x86)\ Koala \ app \ scripts \ FileManager.js中

replace:
exports.userDataDir = path.join(process.env [(process.platform ==='win32')?'USERPROFILE':'HOME'],(process.platform ==='darwin')?'Library / Application Support / Koala / UserData':'。koala');

with:
exports.userDataDir ='C:/Users/Default/docker/.koala';

  1. 在文件C:\ Program Files(x86)\ Koala \ app \ scripts \ pages \ log.js中

replace:
var errorLog = process.env [(process.platform =='win32')?'USERPROFILE':'HOME'] +'/。koala / error.log';

with:
var errorLog ='C:/Users/Default/docker/.koala/error.log';

我的win10系统,账号是汉字,就出现了这个问题,通过上述方法可以解决,

@mrrinn-ies
Copy link

another way I solved this trouble for russian language system and russian user name:
open windows control panel
1- find region & language;
2 - administrative language params;
3 - change system language;
4 - mark checkbox Use unicode (UTF-8);
5- reboot
6 - enjoy your coding!
898e995ca0

p.s. soory for my language, i m just lerning)

This is like 3years later, but even so, thanks so much, i can now compile my SASS with Koala HAHAHAHAHA
Again, thanks so much :D

@op1001
Copy link

op1001 commented Mar 18, 2021

another way I solved this trouble for russian language system and russian user name:
open windows control panel
1- find region & language;
2 - administrative language params;
3 - change system language;
4 - mark checkbox Use unicode (UTF-8);
5- reboot
6 - enjoy your coding!
898e995ca0

p.s. soory for my language, i m just lerning)

Dude, your english is awesome, with your guide I solved this problem just in one minute when I was wondering about this issue for hours before, really thanks! <3 (polish Windows, the solution works perfectly)

@dimpa91
Copy link

dimpa91 commented Jan 2, 2024

2024 - language fix still working, win11, thanks

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

No branches or pull requests