Technology Microsoft Software & solutions

How to Replace UTF 8 in JavasScript

    • 1). Open your HTML file in an editor such as Microsoft Windows Notepad.

    • 2). Insert a script tag in the head section of your HTML file by adding the code:

      <script type="text/javascript">

    • 3). Declare a JavaScript variable and assign it a text value by adding the code:

      var uri = "http://myserver.com/page.asp?type=måle&id=11";

    • 4). Encode a URI component with the "encodeURIComponent" function by adding the code:

      var uri_encode = encodeURIComponent(uri);

      The function encodes characters with their UTF-8 encoding. The "uri_encode" variable now has a value of:

      http%3A%2F%2Fmyserver.com%2Fpage.asp%3Ftype%3Dm%A5le%26id%3D11

    • 5). Store the decoded component of a URI in a variable and end the script by adding the following code:

      uri_decode = decodeURIComponent(uri_encode));

      </script>

      The variable has the value of the original string:

      http://myserver.com/page.asp?type=måle&id=11

    • 6). Save the HTML file and load it on your server to convert the UTF-8 text.

SHARE
RELATED POSTS on "Technology"
How to Configure Oracle 10G for XP Home
How to Configure Oracle 10G for XP Home
How to Use Glass Bottles to Make Windows
How to Use Glass Bottles to Make Windows
What Is Windows Sharepoint Services 3.0?
What Is Windows Sharepoint Services 3.0?
How to Uninstall the Computer Associates eTrust Agent
How to Uninstall the Computer Associates eTrust Agent
How to Boot to Safe Mode on an HP Pavilion dv6000
How to Boot to Safe Mode on an HP Pavilion dv6000
How to Unzip Files in Windows 98
How to Unzip Files in Windows 98
How to Remove Spy.Goldun
How to Remove Spy.Goldun
How to Get Rid of the Trial Period for Adobe Lightroom
How to Get Rid of the Trial Period for Adobe Lightroom
Kindle for PC Installation Problems
Kindle for PC Installation Problems
How to Clean Spyware From the Registry
How to Clean Spyware From the Registry
How to Add Windows XP to Your Laptop
How to Add Windows XP to Your Laptop
How to Uninstall a Paper Port
How to Uninstall a Paper Port
What is Active Sync for X50?
What is Active Sync for X50?
How to Upgrade Windows SharePoint Services
How to Upgrade Windows SharePoint Services
How to Get Windows to Start in an Administrator Account
How to Get Windows to Start in an Administrator Account
How do I Create Restore Diskette for XP?
How do I Create Restore Diskette for XP?
How to Avoid a Cyclic Redundancy Check
How to Avoid a Cyclic Redundancy Check
What Are the Keystrokes for Pasting?
What Are the Keystrokes for Pasting?
How to Make Windows Vista Stop Looking for New Wireless Networks
How to Make Windows Vista Stop Looking for New Wireless Networks
Recommended Hardware Requirements for Running Vista Home
Recommended Hardware Requirements for Running Vista Home

Leave Your Reply

*