0

This solves the broblem:

<script type="text/javascript" src="~/Content/Script/Script.js" charset="windows-1251"></script>

How can I set charset with in Bundles? Code like this:

   Dim bundle As ScriptBundle = New ScriptBundle("~/bundles/global").Include("~/js/jquery.min.js",
                                                                     "~/js/jquery.cookie.js",
                                                                     "~/js/plugins/nicescroll/jquery.nicescroll.min.js",
                                                                     "~/js/plugins/imagesLoaded/jquery.imagesloaded.min.js",
                                                                     "~/js/plugins/jquery-ui/jquery.ui.core.min.js")

How To insert charset in my files js in bundle and mandatory respect order

<%: Scripts.Render("~/bundles/global") %>
  • I would simply re-save Script.is with the UTF-8 encoding (unless you acquire updates to this file from someone who won't switch with you). – Tom Blodget Feb 17 '18 at 14:49
  • How to save script.js to UTF-8 ? – El Mehdi El Mellali Feb 22 '18 at 11:17
  • That's between you, your editor and perhaps your project system. Many editors provide conversion or save-as features. Some project systems keep track of the encoding used for each text file. In Visual Studio, go File » Save As…» Click the down arrow on the button. Select UTF-8 ([without or with BOM](https://stackoverflow.com/a/2223976/2226988)). Remove the charset attribute from your script elements. – Tom Blodget Feb 22 '18 at 11:53

0 Answers0