@@ -80,7 +80,7 @@ public class TaskGenerateUserdevConfig extends DefaultTask {
8080 private String patchesModifiedPrefix ;
8181 private boolean notchObf = false ;
8282 private List <String > universalFilters ;
83- private Charset sourceFileEncoding = StandardCharsets .UTF_8 ;
83+ private String sourceFileEncoding = StandardCharsets .UTF_8 . name () ;
8484
8585 @ Inject
8686 public TaskGenerateUserdevConfig (@ Nonnull final Project project ) {
@@ -115,7 +115,7 @@ public void apply() throws IOException {
115115 json .patchesOriginalPrefix = this .patchesOriginalPrefix ;
116116 json .patchesModifiedPrefix = this .patchesModifiedPrefix ;
117117 json .setNotchObf (this .notchObf );
118- json .setSourceFileCharset (this .sourceFileEncoding . name () );
118+ json .setSourceFileCharset (this .sourceFileEncoding );
119119 if (this .universalFilters != null )
120120 this .universalFilters .forEach (json ::addUniversalFilter );
121121 }
@@ -343,14 +343,14 @@ public void setNotchObf(boolean value) {
343343 }
344344
345345 @ Input
346- public Charset getSourceFileEncoding () {
346+ public String getSourceFileEncoding () {
347347 return this .sourceFileEncoding ;
348348 }
349349 public void setSourceFileEncoding (Charset value ) {
350- this .sourceFileEncoding = value ;
350+ this .sourceFileEncoding = value . name () ;
351351 }
352352 public void setSourceFileEncoding (String value ) {
353- this .sourceFileEncoding = Charset .forName (value );
353+ this .sourceFileEncoding = Charset .forName (value ). name (); //Load then get name to ensure valid.
354354 }
355355
356356 @ Input
0 commit comments