From 8754eaf10901658f925e2914ffe6d5cf20db42d1 Mon Sep 17 00:00:00 2001 From: Yannick Pulver Date: Mon, 22 Nov 2021 22:56:40 +0100 Subject: [PATCH] 0.2.4 - utf8 replacing --- README.md | 4 ++-- src/main/groovy/com/appswithlove/loco/TaskUtils.groovy | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f9b14e..1ab7525 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ buildscript { dependencies { //… - classpath 'com.appswithlove.loco:loco:0.2.3' + classpath 'com.appswithlove.loco:loco:0.2.4' } } ``` @@ -162,7 +162,7 @@ buildscript { ... } dependencies{ - classpath 'com.appswithlove.loco:loco:0.2.3' + classpath 'com.appswithlove.loco:loco:0.2.4' ... } } diff --git a/src/main/groovy/com/appswithlove/loco/TaskUtils.groovy b/src/main/groovy/com/appswithlove/loco/TaskUtils.groovy index 3b52cf9..de226e8 100644 --- a/src/main/groovy/com/appswithlove/loco/TaskUtils.groovy +++ b/src/main/groovy/com/appswithlove/loco/TaskUtils.groovy @@ -54,6 +54,14 @@ class TaskUtils { appendix = "-$lang" } + // In some rare cases, the encoding parameter in the xml-tag is 'utf8' instead of 'utf-8'. + // todo: if there's a better, more reliable solution to handle this, please submit a PR. + def wrongXmlString = '' + if (text.startsWith(wrongXmlString)) { + def expectedXmlString = '' + text = text.replace(wrongXmlString, expectedXmlString) + } + def directory = new File("${locoConfig.resDir}/values$appendix/") if (!directory.exists()) { directory.mkdir()