From 38dbe7600e39731cc603e8adb211b81bd2fee2c0 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 11 Feb 2015 10:13:56 -0500 Subject: [PATCH] Add 'UTF8' encoding alias --- src/main/java/com/gitblit/manager/RepositoryManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gitblit/manager/RepositoryManager.java b/src/main/java/com/gitblit/manager/RepositoryManager.java index 11a48d54..2db41323 100644 --- a/src/main/java/com/gitblit/manager/RepositoryManager.java +++ b/src/main/java/com/gitblit/manager/RepositoryManager.java @@ -1917,12 +1917,14 @@ public class RepositoryManager implements IRepositoryManager { try { // issue-486/ticket-151: UTF-9 & UTF-18 + // issue-560/ticket-237: 'UTF8' Field field = RawParseUtils.class.getDeclaredField("encodingAliases"); field.setAccessible(true); Map encodingAliases = (Map) field.get(null); + encodingAliases.put("'utf8'", RawParseUtils.UTF8_CHARSET); encodingAliases.put("utf-9", RawParseUtils.UTF8_CHARSET); encodingAliases.put("utf-18", RawParseUtils.UTF8_CHARSET); - logger.info("Alias UTF-9 & UTF-18 encodings as UTF-8 in JGit"); + logger.info("Alias 'UTF8', UTF-9 & UTF-18 encodings as UTF-8 in JGit"); } catch (Throwable t) { logger.error("Failed to inject UTF-9 & UTF-18 encoding aliases into JGit", t); } -- 2.39.5