Koala error sass utf 8

Koala 2.2.0 I recently upgraded to 2.2.0 and every time I try and compile from SCSS files I get the following errors: style.scss ArgumentError: invalid byte sequence in UTF-8 Use --trace for backtr...

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

Comments

@ArizonaInkStudios

Koala 2.2.0

I recently upgraded to 2.2.0 and every time I try and compile from SCSS files I get the following errors:

style.scss
ArgumentError: invalid byte sequence in UTF-8
Use —trace for backtrace

This does not happen with javascript files.

I have tried multiple different compiling options from nested all the way to compressed. I have added @charset «utf-8»; to the top to see if that would help, but it does not. I also ensured all of my files were set to be «utf-8»; I still get that error.

What can I do to help you figure this one out! I swear this is not like the last time!!!

@ArizonaInkStudios

I also did not do a full install I just did an upgrade. Just wanted to make sure you had all the information.

@zaygraveyard

Can you try to replace each of the lines 74 and 197 of the file ...KoalaappscriptcompilesSassCompiler.js with command.push('-E UTF-8');?

I don’t know if it will fix the problem but it might.

@ArizonaInkStudios

I changed both of those lines and still received the same error.

I have tried multiple files and even changed the file encoding inside of IntelliJ to make the files UTF-8 encoded; alas, none has worked.
I then opened one of the files in Notepad++ and forced the encoding there to be UTF-8, even though that file was already showing as UTF-8 (I resaved it to be sure), and still I get the same error.

What else can I do for you? I am willing to help out in anyway possible.

@zaygraveyard

Are you importing any third-party files in any of your files?
If so are they UTF-8 encoded?

@ArizonaInkStudios

I am not. The only thing imported into my scss files are other scss I wrote. No third party injection at all.

@ArizonaInkStudios

It also was NOT an issue on the previous version I was using.

@zaygraveyard

Can you send me a file (as is not it’s contents) that will cause this problem? (so I can reproduce it)
And in the mean time you can remove both lines 74 and 197 of the file ...KoalaappscriptcompilesSassCompiler.js to fix the problem.
Oh and which OS are you using?

Thanks

@ArizonaInkStudios

I will remove those lines and see what happens.

I am not sure what you mean by as is, but I can send you a file.

I am on Windows 10, developing with IntelliJ.

@zaygraveyard

Usually sending the contents of code file is equivalent to the file (because the code is just text).
But in this case I’m asking for the actual file.
I think you can add it as attachment in the issues here, but it should be a .txt file otherwise Github wont accept it.

@ArizonaInkStudios

Oh I am with you. Ok, I will do that. I will use the actual file instead of the file from bitbucket just in case something happens in the conversion.

In fact, I will put my local copy AND my bitbucket copy so you can test with both; not that it will matter, but it is at least another road to eliminate.

@zaygraveyard

That would be great 😄, Thanks

@ArizonaInkStudios

@hulkyuan

我也出现同样的报错,错误信息如下
ArgumentError: invalid byte sequence in UTF-8
Use —trace for backtrace.
我同事就可以正常使用,他的版本是2.0.4 我是2.2.0

@UNICORNIOSDECOLORES

Hi! I’m having the same problem :((( Could you solved it? How???

@UNICORNIOSDECOLORES

Also didn’t have this problem with previous versions… i’ve just updated to 2.2.0

@UNICORNIOSDECOLORES

I’ve just realized that the problem was that i was working on flies located in google drive, and i don’t know why this is a problem, but I moved my folder with all the files to the desktop of my pc and now the error is gone!! Just sharing in case it is useful for someone! bye

@duodou

找到问题所在了 文件夹目录必须是英文,不能有中文,就旧版本是可以的

Google Translate
Find the problem where the folder directory must be in English, can not have Chinese, the old version is possible

@zaygraveyard

@ArizonaInkStudios

That was the same issue I was having before I put in your temp fix. My files were all local and had nothing to do with a shared drive. I am still unsure how the error is occurring as IntelliJ is setting the encoding to UTF-8; I even verified that with Notepad++.

Regardless, I did use your temp fix and I am using 2.2.0 flawlessly.

@PengyuanJiang

@lucasmarcelo29

The issue has to do apparently with non UTF-8 characters in the project path. For example, my project was located inside a folder that had the «ñ» character, and when I changed it to a more normal path (C:/whatever/) it worked flawlessly. Maybe that’s not the actual problem, but that’s my guess.

GL.

@chylex

Any updates on the issue? My project path is C:UsersDanDropboxZalohySchoolVŠBVIAProjekt and I’m getting the same error.

@zaygraveyard

@chylex Sorry nothing yet but it’s the next thing on my list.
I’m on a mac and using a VM to run windows so it’s a bit difficult for to work on this.
And the handling of UTF-8 characters in paths on windows is awful.

@lduhaut

Hi !
I have the same on win10, for any path (I tried a dummy scss file in C:/test, and have the same error).
However my user path is C:UsersLoïc, and I can see koala is storing some stuff in C:UsersLoïc.koala. Maybe something here?
Anyway, I can successfully use it on other stations :)

@saturneg

after the change of the user in the name of which the Latin alphabet — the problem disappeared

@ghost

I also have this problem. I changed my username characters to the latin alphabet, but this doesn’t work. Also I noticed that if checked ‘Compass mode‘, this problem gone, but there is appears other problem: ‘stylesheets must be in sass directory‘. And if I move stylesheets to sass folder, it works without problems. But in work projects this a little uncomfortable (because the stylesheets folder may be named ‘scss’ or other name); I hope you will fix this two bugs.

Koala v2.3.0. OS Windows 7 32bit service pack 1

@zaygraveyard

@NelGarbuzova the other problem you faced is AFAIK a requirement for Compass

@ghost

@zaygraveyard thank you. And I find settings for sass folders in koala settings. But without compass mode first problem still apears :(

@valfab06

I have the same problem with windows 10, «ArgumentError ; invalid byte sequence in UTF-8 Use—trace for backtrace» On Mac Os this problem with same folder doesn’t appear.

@iorippi

I’m getting the same error on Koala v2.3.0 on Windows 10 x64!
I just used them in default configuration like ‘Auto Compile’ and ‘Source Map’, so I’m not using compass option.

@luabfr

Hi,
I’ve got the same problem. my problem was the name of the directory (C:UsersLuciano.NerdDesktopblog_otoño_2018blog_(edit) ).

The problem is the letter Ñ. I just premove it.

I think your problem is similar:
C:UsersLoïc
► Try with C:UsersLoic
• C:UsersDanDropboxZalohySchool VŠB VIAProjekt
► Try with C:UsersDanDropboxZalohySchool VSB VIAProjekt

@lduhaut

Hi @luabfr
Yes the problem in my case is for sure the ï letter.
The thing is that Loïc is my username, and this folder is managed by windows, so I cannot (/ don’t know how to) modify it easily. I tried changing my windows username, but it kept the old folder name.
So my only option there would be to create another account and switch between to use Koala… a bit to much for me!

I’ll pick my window username more carefully next time :)

@zaygraveyard

@lduhaut I don’t know if it works but its worth trying:

  1. Create a link (using MKLINK in cmd) from your project(s) folder to somewhere safe (without unicode characters)
  2. Add the newly created link to Koala

Or move your project(s) folder to somewhere safe and link it the other may around (from new path to old path)

@lduhaut

@zaygraveyard thanks for the command, didn’t know about it.

However, in my case, my project is not under C:UsersLoïc. What I said is that I think Koala is storing things under the user profile (that is C:UsersLoïc.koala folder).
So is there any way to configure Koala not to use the user profile folder (If this is the issue, because all these are assumptions for now)

@zaygraveyard

@lduhaut I don’t think this folder is affected by this bug. It’s just for the SCSS and Compass compilers

@lduhaut

@zaygraveyard My problem is about SCSS compiler. In the first time, I placed my project under C:UsersLoïcmyproject, hit the scss compile button, and had the same exact error message (that is :
C:UsersLoïcmyprojectcssstyle.scss
ArgumentError: invalid byte sequence in UTF-8
Use —trace for backtrace
)

Then I tried to move my project under C:test, and still have the same error :
C:testmyprojectcssstyle.scss
ArgumentError: invalid byte sequence in UTF-8
Use —trace for backtrace

So having the same error, I looked where I could have special characters related to Koala, and only found this folder : C:UsersLoïc.koala (which has an empty ‘compilers’ folder). So, now way that this is linked?
Is there any place where logs are generated, so I could be sure it is not? And if not, you might want me to create a separate issue?

@lduhaut

Just to complete my previous post, I just tried to:

  • create another window account, with ‘loduhaut’ as a nickname, instead of ‘Loïc’
  • On this account, use the same exact installation, add the same exact project under C:test, and hit compile
    -> works fine.

So I can’t tell if this is the same issue, but I conclude there is a compiling issue linked to the user profile path under windows.

To go further, I did compare the contents of C:UsersLoïc.koala and C:Usersloduhaut.koala
And in the latter, there is a imports.json file that is generated, and that does not exist in the first one. There is also a new ‘cache’ folder in the second case.
So it looks like, on the scss compilation, Koala tries to create these files, and is not able to (probably because of the ï char of this path).

What do you think?

@zaygraveyard

@lduhaut

@zaygraveyard

So adding something like
if (!fs.existsSync(exports.userCacheDir)) { fs.mkdirSync(exports.userCacheDir); }
in FileManager.js might be enough for my case?

(I’m trying to reproduce it locally, but for now struggling to have ruby and all gems correctly installed …)

Edit: No, as I already tested adding it manually. It’s only a proof it uses this folder.

@lduhaut

@zaygraveyard I successfully ran it from the sources. However, the command with the special character works well in source mode …
C:testkoalasrcrubybinruby -E UTF-8:UTF-8 -S «C:testkoalasrcbinsass» «C:testmyprojectcssstyle.scss» «C:testmyprojectcssstyle.css» —load-path «C:testmyprojectcss» —style nested —cache-location «C:UsersLoïc.koalacache.sass-cache»

So, not able to reproduce :/

@zaygraveyard

@lduhaut AIR, last time I checked this problem I found that there’s something weird happening when nodejs execs a ruby command with non-ascii arguments.
Unfortunately I don’t have a windows but on hand to do more tests 😞

@ArizonaInkStudios

I would also like to point out that I am having the issue from path ‘C:xampphtdocsprojectscss’.

I have no non-ascii characters and I have no filenames that include non-ascii characters. The only non-alphabetical character is the hyphen in my filenames. For example, ‘page-one.scss’.

I hope that helps in the continued troubleshooting.

I am going to upgrade to 2.3.0 and see if I have any issues. If I do, I will apply the original fix that was given to me by removing both lines 74 and 197 of the file …KoalaappscriptcompilesSassCompiler.js to fix the problem. I will let everyone know of my outcome.

@ArizonaInkStudios

With the upgrade to 2.3.0 I am still receiving the same error:
ArgumentError: invalid byte sequence in UTF-8
Use —trace for backtrace

@ArizonaInkStudios

After commenting out lines 74 and 197 of ‘…KoalaappscriptscompilersSassCompiler.js’ I am now working without issue.

I hope this helps, but doubtful as this is the same outcome as the when this bug was opened.

Let me know if I can help!

@lduhaut

@zaygraveyard

Unfortunately I don’t have a windows but on hand to do more tests 😞

If there’s something I can do to help …

Alternatively, would it be possible to check another custom environment variable (i.e. KOALAUSERDATA or something)? If exists, use it, else use the system ones? That’s not pretty, but that would prove the origin of this problem, and allow a workaround for people who cannot easily change their username

@lucas201

@zaygraveyard

@AlexanderPuzanov

Can anyone verify @lucas201’s solution?

Does not work

@vladimir123rus

Try to solve the problem by changing the username to Latin letters. You need to enter the main administrator, change the account name, then rename the folder to C: / User / …, then rename it in the registry: HKEY_LOCAL_MACHINE SOFTWARE Microsoft Windows NT CurrentVersion ProfileList
there, search for a folder with the user whose name you want to change. To me, it helped. Good luck. Sorry for the English.

@vladimir123rus

@danieldid

I’m working on some network storage which looks like this:
\ntfilefreigabenrisprojekt2018 Betrieb für Sozialdienste BozenCSS + JSSGVindiv

I guess it’s a problem with spaces in folder names and / or +, -, _ and so on.

@btboq

Ran into the same problem and this thread solved it for me. On Windows 10 I had the character «Ø» in my account. All I did was create an new admin account named «test», ran Koala and tested the compiler there — it worked. Logged back on to the original account and stuff suddently worked there aswell.

@DenisCherniatev

I my case the problem was in non ASCII chars in my USER_HOME folder. Because Koala stores it’s cache, logs and settings in USER_HOME/.koala.

I’ve solved the problem this way:

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)KoalaappscriptsFileManager.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’;

3. in file C:Program Files (x86)Koalaappscriptspageslog.js

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

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

That’s it. Do not forget save you changes.

@danieldid

I figured out that you aren’t allowed to use special chars and / or umlauts like ä, ö, ü, ß.

Содержание

  1. ArgumentError: invalid byte sequence in UTF-8 Use —trace for backtrace #696
  2. Comments
  3. Koala. Не компилируются файлы sass в css. Как исправить ошибку?
  4. Compile problem UTF-8 #675
  5. Comments
  6. Koala. Не компилируются файлы sass в css. Как исправить ошибку?
  7. Koala: простое решение для использования препроцессоров SASS и LESS
  8. Возможности
  9. Установка
  10. Использование и настройки
  11. Результат работы
  12. Заключение

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

Koala version

Bug report or feature request?

The text was updated successfully, but these errors were encountered:

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

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?

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

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?

@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?

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

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.

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

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

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

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

in file C:Program Files (x86)KoalaappscriptsFileManager.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)Koalaappscriptspageslog.js

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

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

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!

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

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!

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

Thanks! Worked for me great

  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’;

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!

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 😀

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!

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!

Источник

Koala. Не компилируются файлы sass в css. Как исправить ошибку?

Оценить 8 комментариев

ну так вы сделали, что вас попросила программа?
Use —trace for backtrace.

Делайте, и вывод сюда скидывайте. Тогда можно будет предметно показать в чем ошибка.

У меня все заработало после следующего гайда — (цитирую)
B настройки Win-10 ввести изменение: Параметры Windows > Время и язык > Язык > Административные языковые параметры > Нажать кнопку: Изменить язык системы > Поставить галочку: Бета-версия:. Использовать Юникод (UTF-8) для поддержки языка во всем мире.

И все заработало. Надеюсь, ты прокрутил до конца и увидел это сообщение. Я перепробовал все в этой ветке и помогло только это решение.

, через ruby , до установки коаллы и потом галка

Здравствуйте!
Изучил все ответы в данной ветке.
У меня похожая проблема, при попытке компиляции Koala выдаёт такую ошибку «ArgumentError: invalid byte senquence in UTF-8 Use —trace for backtrace».

Какие решения пробовал:
— размещать файлы проекта в корне локального диска, таким образом что бы весь путь состоял только из латинский символов». Ноль эффекта, компилятор выдаёт такую же ошибку.
— устанавливал другие версии Koala. В том числе рекомендуемую здесь версию 2.1.4. Ни одна из них кроме самой последней (2.3.0) не запустилась на моём ПК (OC Windows 10).

Включать поддержку кодировки UTF в системе не хочу. Причина в том, что как я прочитал в другом источники это ведёт к появлению ошибок в других программах и дополнениях. Например перестаёт запускаться плагин Open Server для VSCode.

Возможно кто-нибудь знает другие способы решения проблемы с восприятием кодировки у Koala?

Источник

Compile problem UTF-8 #675

Hi. I wanted to compile scss to css. I made test folder in which I have 2 folders scss and css. I made empty style.scss and style.css file. Then I put @charset «UTF-8»; in the beggining of style.scss file. I changed output path but still I get this error:

ArgumentError: invalid byte sequence in UTF-8 Use —trace for backtrace.

The text was updated successfully, but these errors were encountered:

I checked files in notepad++ and both are encoded in utf-8.

Duplicate of #648
Can you verify that the files are on your local machine and their path doesn’t contain non-ASCII chars?

I changed path to C:xampphtdocstestscss and it still doesn’t work

Is the «compass» option activated?

I changed it and now I have Individual stylesheets must be in the sass directory.

I’ll check it out tonight, can you give me the directory structure of the project and the contents of the files? (so I can reproduce it)

As I wrote I have one main folder named test and there are 2 folders inside — css and scss. Then in scss folder I have style.scss and in css folder I have style.css file. That’all, nothing more.

Ok great, thanks
I’ll let you know what I find

Sorry but I’m unable to reproduce it 😞

I’m on windows 10 home 64bit

I have the same problem

@zhaugahsarov I’m assuming you’re on Windows, which version?
And are you using the latest version of Koala (v2.3.0)?

@zaygraveyard yes I’m on windows 10.
And the version of Koala 2.3.0.
I can send my scss file, if you want to reproduce the error

Источник

Koala. Не компилируются файлы sass в css. Как исправить ошибку?

Оценить 8 комментариев

ну так вы сделали, что вас попросила программа?
Use —trace for backtrace.

Делайте, и вывод сюда скидывайте. Тогда можно будет предметно показать в чем ошибка.

У меня все заработало после следующего гайда — (цитирую)
B настройки Win-10 ввести изменение: Параметры Windows > Время и язык > Язык > Административные языковые параметры > Нажать кнопку: Изменить язык системы > Поставить галочку: Бета-версия:. Использовать Юникод (UTF-8) для поддержки языка во всем мире.

И все заработало. Надеюсь, ты прокрутил до конца и увидел это сообщение. Я перепробовал все в этой ветке и помогло только это решение.

, через ruby , до установки коаллы и потом галка

Здравствуйте!
Изучил все ответы в данной ветке.
У меня похожая проблема, при попытке компиляции Koala выдаёт такую ошибку «ArgumentError: invalid byte senquence in UTF-8 Use —trace for backtrace».

Какие решения пробовал:
— размещать файлы проекта в корне локального диска, таким образом что бы весь путь состоял только из латинский символов». Ноль эффекта, компилятор выдаёт такую же ошибку.
— устанавливал другие версии Koala. В том числе рекомендуемую здесь версию 2.1.4. Ни одна из них кроме самой последней (2.3.0) не запустилась на моём ПК (OC Windows 10).

Включать поддержку кодировки UTF в системе не хочу. Причина в том, что как я прочитал в другом источники это ведёт к появлению ошибок в других программах и дополнениях. Например перестаёт запускаться плагин Open Server для VSCode.

Возможно кто-нибудь знает другие способы решения проблемы с восприятием кодировки у Koala?

Источник

Koala: простое решение для использования препроцессоров SASS и LESS

Обычные редакторы кода, такие, как PhpStorm, Brackets или SublimeText с компиляторами не очень дружны. Процесс инсталляции нетривиален и иногда заставляет помучаться даже опытных разработчиков. Дополнительные плагины, которые требуются для работы препроцессора, могут вызывать конфликты, чувствительны к номеру версии, иногда придётся выставлять тонкие настройки и лезть «в кишочки» к системе. Другим решением (и более грамотным) будет использование сборщиков, таких как Gulp, однако, они требуют уже более серьёзной квалификации.

Чтобы обойти эти проблемы, было предложено несколько программных продуктов, из которых наибольшую популярность получила Koala, в силу своей простоты и бесплатности. Давайте пробежимся по её возможностям.

Возможности

Работает она так – вы запускаете программу, указываете исходную папку, в которой лежит код, написанный с применением препроцессора и конечную папку, в которой будет компилироваться файл CSS.

Программа имеет скромные размеры, около 100Мб. Потребление памяти и ресурсов процессора, разумеется, зависит от количества установленных проектов, однако, я бы сравнил её по ресурсоёмкости, например со Скайпом. Как и GoogleChrom, запускает несколько отдельных процессов, что хорошо видно в диспетчере. И чем больше проектов одновременно поддерживается – тем больше процессов.

Функционал, действительно, мощный:

  • Работа с препроцессорами SCSS, LESS и Compass;
  • Сборка одного CSS файла из нескольких импортируемых;
  • Компиляция CoffeeScript;
  • Минификация (сжатие) кода;
  • Автоматическая расстановка вендорных префиксов;
  • Несколько стилей вывода;
  • Работа с собственными библиотеками или с системными компиляторами на выбор.

Обработка может проходить в автоматическом режиме – то есть, Коала мониторит ваши файлы и при внесении изменений обрабатывает проект, либо в ручном – вы сами запускаете сборку, когда вам это нужно. Очевидно, что второй вариант экономит ресурсы компьютера и если у вас кода написано уже много, а машина слабовата, то лучше применять его.

Переходим к установке.

Установка

Скачать дистрибутив Koala можно здесь, посмотреть код и полистать гит-ветку здесь. Там же выложена и документация.

Сайт двуязычный (есть только английская и китайская версии), однако, сама программа поддерживает 12 языков, в том числе и русский (скажем за это спасибо переводчику Юрию Меркушину). Помимо основной «окошечной» версии, есть локализации для Linux и MacOS.

Скачивание и установка проблем не вызывает. Вы просто нажимаете большую зелёную кнопку с надписью «Download», закачиваете дистрибутив 80Мб на диск и запускаете. Не нужно ни регистрироваться, ни заполнять километровые анкеты, ни заводить учётные записи. При установке программа спросить, создавать ли иконку на рабочем столе и мини-иконку в трее – что вы решаете сами, по желанию. В остальном тоже ничего принципиально сложного нет, поэтому сразу можно переходить к работе.

Использование и настройки

Давайте запустим Koala и начнём работу над проектом. Для этого создадим папку проекта и в нём отдельную папку SCSS. Запишем туда файлы со следующим содержанием:

style.scss

_normalize.scss

_core.scss

Важно! Путь к папке проекта не должен содержать кириллических символов. Иначе компилятор может выдать ошибку.

Запускаем Koala и видим вот что.

Как видите, интерфейс у программы проще некуда. Слева три кнопочки – добавить проект, журнал и настройки. Справа большое окно проектов. Заглянем в настройки.

В основной вкладке можно выбрать язык. Далее переходим во вкладку SASS. Здесь по желанию можно указать принудительную расстановку автопрефиксов (1) и выбрать тип вывода (2). Их четыре, с разной степенью минификации.

Важно! Работоспособность может зависеть от того, будет ли программа формировать код с использованием собственной библиотеки или системного компилятора.

Конечно, проще, если Koala справится сама, и не придётся устанавливать ничего дополнительно. Однако, как показала моя практика, иногда встроенная библиотека не тянет (выдаёт ошибку «ArgumentError: Invalid byte sequence in UTF-8») – в таком случае нужно устанавливать компилятор глобально и заставлять программу использовать именно его.

Жмём крестик и добавляем нашу папку SCSS. Получаем вот что.

Чтобы появилась боковая панель справа, достаточно кликнуть по строке проекта. Как видим, в ней всё те же настройки, что мы уже видели, плюс появился чекбокс «автокомпиляция» и кнопка «compile».

Укажем путь для вывода файлов. Для этого щёлкнем по строке проекта правой кнопкой мыши и зададим путь к папке CSS. Тут программа ведёт себя немного странно – нужно не просто указать папку, а прямо задать конечный файл, куда будет собираться проект. В нашем случае style.css. Если путь не указывать, итоговый файл будет формироваться в то же папке, где лежат исходники.

После этого сверху появилась зелёная кнопка «обновить». Жмём. В папке CSS появились два файла — style.css и style.css.map. Если не появились (программа иногда задумывается – Коала, как-никак), то опять нажимаем на строку проекта левой кнопкой и в появившейся справа панели запускаем «compile».

Результат работы

Итак, поздравляю, вы пригласили Вия вот наш скомпилированный файл.

Добавим в исходник _core.scss, например, строку font-size: 16px; и включим автопрефиксы. Итоговый код поменялся:

Можно поэкспериментировать с разными стилями вывода.

При режиме «expand» закрывающие скобки – > – будут не после точек с запятой, а переместятся на следующую строку. При режиме «compact» каждый класс займёт одну строчку, а свойства вытянутся в линию. Наконец, «compressed» соберёт весь код в единственную строку – идеальный вариант, если вы боретесь за скорость загрузки сайта.

Заключение

Koala – простой и интуитивно понятный инструмент для работы с препроцессорами SCSS и LESS. Он позволит добавить в ваш css-код вендорные префиксы, выполнит минификацию и сборку. А главное – выручит вас, если нет желания и сил тратить время, настраивая плагины под свой редактор кода.

Есть у программы и свои недостатки. Сообщество отмечало конфликты в среде Windows 10, проблемы с расстановкой автопрефиксов для свойств flex и даже сбои при работе со шрифтами от Гугла. Настораживает и то, что разработчики, похоже, охладели к своему детищу – последний релиз вышел в октябре 2017 года. Тем не менее, пока Koala вполне работоспособна и сможет вас порадовать.

Источник

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

Comments

zbin1988 commented Oct 30, 2017

Koala version

Bug report or feature request?

The text was updated successfully, but these errors were encountered:

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 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 commented Jan 7, 2018

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

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 commented Jan 8, 2018

@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 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 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 commented Jun 21, 2018

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 Jul 16, 2018

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

DenisCherniatev commented Jul 25, 2018

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

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

in file C:Program Files (x86)KoalaappscriptsFileManager.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)Koalaappscriptspageslog.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 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!

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

Maximillliano commented Dec 6, 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!

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

Thanks! Worked for me great

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’;

mrrinn-ies commented Mar 10, 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!

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 😀

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!

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!

Источник

ArgumentError: invalid byte sequence in UTF-8 #673

Comments

mensfeld commented Mar 30, 2014

Hey guys. Rack gets crazy when you pass invalid UTF-8 string.

You can try with putting this into app URL:

It will brake app with this error: ArgumentError: invalid byte sequence in UTF-8

The text was updated successfully, but these errors were encountered:

nijikon commented Mar 30, 2014

karol-blaszczyk commented Mar 30, 2014

raggi commented Apr 1, 2014

It is a web servers responsibility to translate IO to valid binary representations for the application layer. This isn’t the whole picture though, in this case, the webserver has done that — the webserver does not know the encoding of the URI.

It is the responsibility of the IETF to define the validity of URI data in various encodings (not done), and so it is not entirely valid for web servers to make no assumptions for this field for the above.

Rack itself uses a binary regular expression here, which expects binary input strings. This is our response to the above subtleties. In normal operation (say, Webrick + Rack), this error is not raised.

The reason that this error is raised in your application is:

You have middleware in your stack that is forcing this string to UTF-8, even when it is not valid UTF-8. The code that is doing this is bugged.

This is a rails bug. Calls to force_encoding should always assert that their output is valid.

mensfeld commented Apr 2, 2014

@raggi Thx 🙂 sorry for that — cheers!

nanaya commented May 18, 2014

You have middleware in your stack that is forcing this string to UTF-8, even when it is not valid UTF-8. The code that is doing this is bugged.

This part does default to UTF-8, though. And thanks to that, trying to do a parse_nested_query with invalid key string will raise ArgumentError as I mentioned in issue #610, without obvious way to change it.

kennym commented Jul 17, 2014

Just leaving this in case of anyone is having trouble with Rails: https://github.com/whitequark/rack-utf8_sanitizer/

rgaufman commented Jan 6, 2022

I get this occasional exception in production, what is the correct solution for this?

raggi commented Jan 6, 2022

@rgaufman in your question you ask about what is the correct solution, but I’m not clear on the problem. You reference an exception that occurs due to malformed input. What is the problem you want to solve?

rgaufman commented Jan 7, 2022

I suppose this does what I want: https://github.com/whitequark/rack-utf8_sanitizer/ — trying it now to see if these exceptions go away. These exceptions are coming from I’m guessing random hacking attempts? — what is the right way to handle these bad requests? — should I use fail to ban or something similar, are there examples of what to do about these?

csuhta commented Jan 7, 2022 •

@rgaufman in your question you ask about what is the correct solution, but I’m not clear on the problem. You reference an exception that occurs due to malformed input. What is the problem you want to solve?

The main issue here is that (with many common setups) Rack will raise this exception when anyone in the world (bots, people testing, search engines) drive by your Rack-powered site and submit a URL with invalid params. This is super annoying if you use an exception collation service.

I’m not sure if the issue stems from other parts of the Ruby application sending Rack invalid text, but I’ve mostly seen it occur with both Puma + Rails and Unicorn + Rails. One or several of those gem authors may not know that they are responsible for sending Rack cleaned up-input or being the guardian process, like you specified in this comment #673 (comment)

This error also takes other forms such as exception messages containing:

csuhta commented Jan 7, 2022 •

Another way to state the problem would be:

Given that there’s usually three «layers» to a Ruby web app:

  1. A web server (Puma, Webbrick, etc)
  2. Rack
  3. The application (Rails, Roda, etc)

Which interface is officially responsible for handling invalid UTF-8 or incoming malformed text in URLs or HTTP headers is not well-agreed by the different gem authors, which leads to encoding problems sometimes blowing up in the Rack layer (and people creating middleware to just catch/sanitize/discard/422 the requests «manually»)

jeremyevans commented Jan 7, 2022

IMO, there are really only two layers, webserver and application. The rack layer I think refers to middleware, but middleware are just rack applications that (usually) delegate to other rack applications. Middleware can be written using the same frameworks used to write applications, though I’m don’t think Rails supports operating as middleware. So IMO, there is no difference between the rack and application layers.

Also IMO, the application layer is the proper layer for such exception handling. Most applications try to show nice error pages even for invalid input, and in general that is only possible at the application layer. Some applications might only want to deal with UTF-8, and reject input in other encodings (or transcode to UTF-8), while there are other applications (less frequent these days) that deal with non-UTF-8 data, and may want to reject UTF-8 or convert it to another encoding (if possible).

I think classes the rack library exposes (e.g. Rack::Request ), as well as utility methods (e.g. Rack::Utils#unescape ), could probably do a better job of error handling, such as raising more specific exception classes for encoding issues/invalid input. This would allow applications using those parts of the rack library to globally rescue such exceptions and centrally handle them. Maybe such nicer error handling is something we could ship in Rack 3.

raggi commented Jan 7, 2022

In terms of the call stack in @rgaufman’s recent first comment, the multipart middleware could catch this exception and handle it gracefully, returning a 400 Bad Request instead. A patch would need to be introduced here: https://github.com/rack/rack/blob/master/lib/rack/multipart.rb#L45. As @jeremyevans rightly notes, a more specific error would be helpful — in the past there’s been discussion about requesting that the Stdlib itself produces a more specific error, too.

In the more general case, the issue with this exception is that it can come from any use of query parsing in any middleware that uses either the Rack helper libraries that delegate to the stdlib parser, or from use of the stdlib parser itself. The helper libraries can not return a 400 themselves — the middleware / app callers must do so, so they must catch the exception.

@csuhta your response implies a lot of blame, suggesting that the issue is as simple as a lack of agreement. Many of the code bases involved are themselves encoding agnostic at large, it’s once you start making use of encoding specific features that you run into more interesting challenges. When using a framework like Rails, being sure to use it’s helpers to generate forms and so on will add explicit declarations to improve the situation. Using, say, part of Rails, but then writing raw form tags yourself or with an entirely separate template system may lead to these situations, as does serving an API and having customers using older HTTP client libraries, or say, defaults on a lot of more enterprise stacks on Windows. «We» the authors have actually discussed encodings at length, I believe Yehuda even wrote quite a bit about those discussions, back in the day. We’ve also done some relatively extensive browser behavior research such as https://github.com/rack/multifail.

A more general solution to the «please don’t raise exceptions» problem: if you know your application is going to be using these helpers, perform this parse first (hit Request#params) handling the exception. Rack::Request#params caches the parse results, so this should not add significant overhead to your application.

Such a middleware would look like so:

csuhta commented Jan 7, 2022

My teams currently use a middleware very much like that, and I agree that a much more specific exception being raised would be really helpful (rescuing all ArgumentError and checking the exception messages is a smell)

I didn’t mean to imply that anyone in particular is to blame or is dropping the ball, just that the solution in this scenario is often unclear to the application author or the responsibilities are not being explicitly set.

For example, if you are starting out with Rails development and you choose Puma + Rails (and Rack implicitly), and your web app starts getting even moderate traffic, you will run into these kinds of encoding exceptions just from drive-by visitors, and from there it makes it seem like the error is coming from Rack and the proper pattern to solve it is really only discussed in GitHub threads like these.

I agree it should probably be handled by the application layer or middleware, so that you can serve a nice error page or you can attempt to sanitize the string if you really need to be kind to certain incoming requests.

A good way to approach it in Rack 3 (at least for my team’s use cases) would be a suite of more specific exceptions being raised, and also documentation that the application is responsible for deciding how they deal with the exceptions/strings

Источник

Koala version

Bug report or feature request?

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

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?

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

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?

@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?

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

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.

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

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

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)KoalaappscriptsFileManager.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)Koalaappscriptspageslog.js

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

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

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)

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

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

  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系统,账号是汉字,就出现了这个问题,通过上述方法可以解决,

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

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)

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Knights of honor как изменить разрешение экрана
  • Knight fight 2 ошибка 503
  • Kndbwm exe ошибка приложения windows 10
  • Kmsset kms service start error kmsdel kms service stop error
  • Kmsauto при установке ключа произошла ошибка gvlk key notfound

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии