一个简单的ruby代码,puts一个中文,显示乱码

# -*- coding: utf-8 -*-
puts "你好"
require_relative  'calc.rb'

# require_relative 'net/ssh'
# test


puts $$

 

我这里设置了utf-8的编码格式了啊,怎么还是乱码呢?

 

其实还需要再RubyMine进行如下的设置,我现在使用的 RubyMine2019版本

 

file---Settings---Editor---Fileconding中修改Global Encoding和Porject Encoding的编码格式为“”utf-8“”即可

相关文章:

  • 2022-01-11
  • 2021-09-05
  • 2021-11-09
  • 2022-12-23
  • 2021-09-25
  • 2021-04-19
  • 2022-12-23
  • 2021-03-26
猜你喜欢
  • 2021-10-24
  • 2021-09-25
  • 2021-12-25
  • 2022-02-16
  • 2022-01-14
相关资源
相似解决方案