atom-community / atom-community/atom-script

ruby script output in utf8

Open
#1,115 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
730
Forks
264
PR merge metrics
No merged PRs in 30d

Description

Hello, atom-script team

How to set console encoding in yours plugin?

When I execute my code from windows console I see correct uft8

```
c:\Users\n.voynov\Documents\ruby\acontrol>ruby lib/acontrol/models/aobject.rb
[#1, :title=>"Відкрита"}>,
#2, :title=>"Державна інформаційна"}>,
#3, :title=>"Конфіденційно (персональні дані)"}>,
#4, :title=>"Таємно"}>,
#5, :title=>"Цілком таємно"}>]
```

But when I do the same thing through atom-script I see the next output

```
[#1, :title=>"\u0412\u0456\u0434\u043A\u0440\u0438\u0442\u0430"}>,
#2, :title=>"\u0414\u0435\u0440\u0436\u0430\u0432\u043D\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u0439\u043D\u0430"}>,
#3, :title=>"\u041A\u043E\u043D\u0444\u0456\u0434\u0435\u043D\u0446\u0456\u0439\u043D\u043E (\u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u0456 \u0434\u0430\u043D\u0456)"}>,
#4, :title=>"\u0422\u0430\u0454\u043C\u043D\u043E"}>,
#5, :title=>"\u0426\u0456\u043B\u043A\u043E\u043C \u0442\u0430\u0454\u043C\u043D\u043E"}>]
```

It's OK if I try simple output Cyrillic symbols

```
# encoding: UTF-8
puts "Привет"
```

The ouptput is

```
Привет
[Finished in 0.209s]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.