vendredi 13 septembre 2019

How can i read from a document.txt lines with emoji and show them on terminal when i run the ruby code?

I want to read a document file .txt in Ruby but the following lines of this document contain emojis and when i run the program it shows me different symbols and not the actual emoji. I have already tried different methods. How can i do this , should i install any gem ??

file='document.txt'

This document contains the following line with emojis

This is a test line đŸ”„đŸ”„đŸ”„

  File.readlines(file).each do |line|

      puts line

  end

Aucun commentaire:

Enregistrer un commentaire