From de095953cc8ba041d1074e3512a84ac879b653b5 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 30 Jun 2023 14:07:10 +0800 Subject: [PATCH] =?UTF-8?q?readme=20GBK=E7=BC=96=E7=A0=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/repositories_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 4ddae72d5..dbdc8fc79 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -208,7 +208,7 @@ module RepositoriesHelper if is_readme?(entry['type'], entry['name']) Rails.logger.info("entry===#{entry["type"]} #{entry["name"]}") content = entry['content'].present? ? entry['content'] : Gitea::Repository::Entries::GetService.call(owner, repo.identifier, URI.escape(entry['path']), ref: ref)['content'] - # Rails.logger.info("content===#{content}") + Rails.logger.info("Base64.decode64(content).encoding===#{Base64.decode64(content).encoding}") return Base64.decode64(content).force_encoding("GBK").encode("UTF-8") if Base64.decode64(content).encoding == Encoding::ASCII_8BIT return Base64.decode64(content).force_encoding('UTF-8') else