oklai / koala

Koala is a GUI application for less, sass and coffeescript compilation, to help web developers to the development more efficient.
http://koala-app.com
Other
3.99k stars 522 forks source link

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

Open zbin1988 opened 7 years ago

zbin1988 commented 7 years ago

Koala version

Bug report or feature request?

boyum commented 7 years ago

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

TorvaldC commented 6 years ago

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 commented 6 years ago

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

TorvaldC commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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

TorvaldC commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

DenisCherniatev commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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

  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 commented 3 years ago

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 commented 3 years ago

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 commented 10 months ago

2024 - language fix still working, win11, thanks