Answer the question
In order to leave comments, you need to log in
How to fix encoding error (IBM866 and ASCII-8BIT)?
How to remove an encoding error when Russian characters appear in file records? (Error: incompatible character encodings: IBM866 and ASCII-8BIT)
If there are no Russian letters in the files, then everything works fine.
Here is the content of the app.rb files
get '/controlpanel' do
@file_visitors = File.read('./public/visitors.txt')
@file_contacts = File.read('./public/contacts.txt')
erb :controlpanel
end
<html>
<head>
</head>
<body>
<h2>Панель управления</h2>
<div>
<% @file_visitors.each_line do |line| %>
<%= line %>
<% end %>
<% @file_contacts.each_line do |line| %>
<%= line %>
<% end %>
</div>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question