编码问题

dev_cs
daiao 5 years ago
parent f2b036b659
commit bef787c089

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

@ -474,7 +474,7 @@ class ShixunsController < ApplicationController
ShixunSchool.create!(arr)
end
# 超级管理员和运营人员才能保存 中间层服务器pod信息的配置
if current_user.admin? || current_user.business?
#if current_user.admin? || current_user.business? ||
@shixun.shixun_service_configs.destroy_all
service_config_params[:shixun_service_configs].each do |config|
logger.info("####{config[:mirror_repository_id]}")
@ -482,7 +482,7 @@ class ShixunsController < ApplicationController
# 不保存没有镜像的配置
@shixun.shixun_service_configs.create!(config) if name.present?
end
end
#end
# 添加第二仓库
if params[:is_secret_repository]
add_secret_repository

Loading…
Cancel
Save