@@ -398,23 +398,11 @@ private void processArgument() throws CommandLineException {
398
398
config .setOption (OptionsCatalog .INTERNAL_ENCODING , encodingNames .substring (index + 1 ));
399
399
}
400
400
break FOR ;
401
- } else if (argument .startsWith ("--external-encoding" )) {
402
- if (argument .equals ("--external-encoding" )) {
403
- characterIndex = argument .length ();
404
- String feature = grabValue (getArgumentError ("missing argument for " + argument ), false );
405
- argument = argument + "=" + feature ;
406
- }
407
- final String encodingName = argument .substring (argument .indexOf ('=' ) + 1 );
408
- config .setOption (OptionsCatalog .EXTERNAL_ENCODING , encodingName );
409
- break FOR ;
410
- } else if (argument .startsWith ("--internal-encoding" )) {
411
- if (argument .equals ("--internal-encoding" )) {
412
- characterIndex = argument .length ();
413
- String feature = grabValue (getArgumentError ("missing argument for " + argument ), false );
414
- argument = argument + "=" + feature ;
415
- }
416
- final String encodingName = argument .substring (argument .indexOf ('=' ) + 1 );
417
- config .setOption (OptionsCatalog .INTERNAL_ENCODING , encodingName );
401
+ } else if (argument .equals ("--external-encoding" ) || argument .equals ("--internal-encoding" )) {
402
+ // Just translate to option=value form and let the Launcher handle it
403
+ characterIndex = argument .length ();
404
+ String feature = grabValue (getArgumentError ("missing argument for " + argument ), false );
405
+ config .getUnknownArguments ().add (argument + "=" + feature );
418
406
break FOR ;
419
407
} else if (argument .equals ("--yydebug" )) {
420
408
disallowedInRubyOpts (argument );
0 commit comments