Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7766201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:21:15+00:00 2026-06-01T15:21:15+00:00

I have a HTML that includes a Javascript file. This script contains a special

  • 0

I have a HTML that includes a Javascript file. This script contains a special character, ASCII 152. When I try to display the charCodeAt, I get different results, but never the right one. Could you please advice? Thanks

TEST.HTML

<script type="text/javascript" charset=SEE BELOW src="test.js">
</script>

TEST.JS file with ANSI encoding

function d(a)
{
a=(a+"").split("");
alert(a[1].charCodeAt(0));
};
d("i˜g"); // Note that ˜ is 152 in ASCII
  • TEST.HTML with x-user-defined charset: alert shows 63384. With %63232 works, as every char >128 is displayed as 63232+char.
  • TEST.HTML with utf-8 charset: alert shows 65533. All chars > 128 are displayed as 65533.
  • TEST.HTML with Windows-1252 charset: alert shows 752. I cannot find a relation between ASCII and what is displayed.

TEST.JS file with UTF-8 encoding

function d(a)
{
a=(a+"").split("");
alert(a[1].charCodeAt(0));
};
d("i[x98]g"); // Note that x98 is 152
  • TEST.HTML with x-user-defined charset: alert shows 65533. All chars > 128 are displayed as 65533.
  • TEST.HTML with utf-8 charset: alert shows 65533. All chars > 128 are displayed as 65533.
  • TEST.HTML with Windows-1252 charset: alert shows 65533. All chars > 128 are displayed as 65533.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:21:17+00:00Added an answer on June 1, 2026 at 3:21 pm

    There is no characters in range 128-255 for utf8, and ASCII ends completely at 127… Also the character at position 1 in "i[x98]g" is a "[", the "[x98]" is meaningless.

    Your function can be replaced with str.charCodeAt(1).

    The character ˜ is
    Unicode Character ‘SMALL TILDE’ (U+02DC and can be written as "\u02DC", or String.fromCharCode(732)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script (index.php) that includes an index.html file in a sub-directory
Within my HTML, I have a php script that includes a file. At that
I have a html component that includes some javascript. The component is a file
I have code below of an HTML page that includes a JS file. Function
I have some HTML that looks like this: <div> <div class=value> <a href=# class=clicker>Some
I have an external javascript file that I want to, upon include, write some
I have a javascript routine that dynamically creates an HTML page, complete with it's
I have this file: app/views/listings/list.html.erb in my rails project. Here are the contents of
I have a html_headers.inc.php script that I want to include in every script on
I have extended the ASP.NET MVC Html Helper to include my own ValidationImage that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.