dev_jupyter
daiao 5 years ago
parent 984281bc0f
commit 6f6196f7dc

@ -26,6 +26,7 @@ module GitHelper
if cd["encoding"] == 'GB18030' && cd['confidence'] > 0.8
content.encode('UTF-8', 'GBK', {:invalid => :replace, :undef => :replace, :replace => ' '})
else
Rails.logger.info("####encoding:#{content.encoding}")
content.force_encoding('UTF-8')
end
end

@ -3,6 +3,7 @@ class ShixunsController < ApplicationController
include ApplicationHelper
include ElasticsearchAble
include CoursesHelper
include GitCommon
before_action :require_login, :check_auth, except: [:download_file, :index, :menus, :show, :show_right, :ranking_list,
:discusses, :collaborators, :fork_list, :propaedeutics]
@ -877,7 +878,7 @@ class ShixunsController < ApplicationController
end
end
include GitCommon
def update_file
content = params[:content]

Loading…
Cancel
Save