mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
attempted fix for weird encoding problem
This commit is contained in:
parent
1f01baf664
commit
cb1bb24d86
1 changed files with 5 additions and 2 deletions
|
@ -59,7 +59,10 @@ def encoding_fix(file)
|
|||
begin
|
||||
Rack::Utils.escape_html file
|
||||
rescue ArgumentError => e
|
||||
return Rack::Utils.escape_html(file.force_encoding('BINARY')) if e.message =~ /invalid byte sequence in UTF-8/
|
||||
if e.message =~ /invalid byte sequence in UTF-8/ ||
|
||||
e.message =~ /incompatible character encodings/
|
||||
return Rack::Utils.escape_html(file.force_encoding('BINARY'))
|
||||
end
|
||||
fail
|
||||
end
|
||||
end
|
||||
|
@ -72,4 +75,4 @@ def send_confirmation_email(site=current_site)
|
|||
subject: "[Neocities] Confirm your email address",
|
||||
body: Tilt.new('./views/templates/email_confirm.erb', pretty: true).render(self, site: site)
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue