mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +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
|
begin
|
||||||
Rack::Utils.escape_html file
|
Rack::Utils.escape_html file
|
||||||
rescue ArgumentError => e
|
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
|
fail
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue