diff --git a/packages/flutter_tools/lib/src/isolated/devfs_web.dart b/packages/flutter_tools/lib/src/isolated/devfs_web.dart index d41853a01f..89487edcc3 100644 --- a/packages/flutter_tools/lib/src/isolated/devfs_web.dart +++ b/packages/flutter_tools/lib/src/isolated/devfs_web.dart @@ -50,10 +50,12 @@ typedef DwdsLauncher = required ToolConfiguration toolConfiguration, }); -// A minimal index for projects that do not yet support web. +// A minimal index for projects that do not yet support web. A meta tag is used +// to ensure loaded scripts are always parsed as UTF-8. const String _kDefaultIndex = ''' + diff --git a/packages/flutter_tools/lib/src/web/bootstrap.dart b/packages/flutter_tools/lib/src/web/bootstrap.dart index 633b7ed06d..eb1877942b 100644 --- a/packages/flutter_tools/lib/src/web/bootstrap.dart +++ b/packages/flutter_tools/lib/src/web/bootstrap.dart @@ -6,14 +6,6 @@ import 'package:package_config/package_config.dart'; /// Used to load prerequisite scripts such as ddc_module_loader.js const String _simpleLoaderScript = r''' -// Declare the character set of the document to align with require.js. Using a -// meta element is preferable to changing the individual script elements' -// `charset` as the scripts should inherit the document's character set, and -// modifying a script element's character set is deprecated. -var meta = document.createElement('meta'); -meta.charset = 'utf-8'; -document.head.insertBefore(meta, document.head.firstChild); - window.$dartCreateScript = (function() { // Find the nonce value. (Note, this is only computed once.) var scripts = Array.from(document.getElementsByTagName("script"));