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

  • Home
  • SEARCH
  • 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 135051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:43:27+00:00 2026-05-11T06:43:27+00:00

We have an external .js file that we want to include in a number

  • 0

We have an external .js file that we want to include in a number of different pages. The file contains code for sorting a table on the client-side, and uses the ▲ and ▼ characters in the script to indicate which column is sorted and in which direction.

The script was originally written for an ASP.Net page to offload some sorting work from the server to client (prevent sorting postbacks when javascript is enabled). In that case, the encoding is pretty much always UTF-8 and it works great in that context.

However, we also have a number of older Classic ASP pages where we want to include the script. For these pages the encoding is more of a hodgepodge depending on who wrote the page when and what tool they were using (notepad, vs6, vs2005, other html helper). Often no encoding is specified in the page so it’s up to the browser to pick, but there’s really no hard rule for it that I can see.

The problem is that if a different (non-UTF8) encoding is used the ▼ and ▲ characters won’t show up correctly. I tried using html entities instead, but couldn’t get them to work well from the javascript.

How can I make the script adjust for the various potential encodings so that the ‘special’ characters always show up correctly? Are there different characters I could be using, or a trick I missed to make the html entities work from javascript?

Here is the snippet where the characters are used:

// get sort direction, arrow var dir = 1; if (self.innerHTML.indexOf(' ▲') > -1)                 dir = -1; var arrow = (dir == 1)?' ▲':' ▼';   // SORT   -- function that actually sorts- not relevant to the question if  (!SimpleTableSort(t.id, self.cellIndex, dir, sortType)) return;  //remove all arrows for (var c = 0,cl=t.rows[0].cells.length;c<cl;c+=1) {     var cell = t.rows[0].cells[c];     cell.innerHTML = cell.innerHTML.replace(' ▲', '').replace(' ▼', ''); }  // set new arrow self.innerHTML += arrow; 

For the curious, the code points I ended up using with the accepted answer were \u25B4 and \u25BC.

  • 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. 2026-05-11T06:43:27+00:00Added an answer on May 11, 2026 at 6:43 am

    You want Javascript Unicode escapes i.e. ‘\uxxxx’, where ‘xxxx’ is the Unicode code point for the character. I believe ‘\u25B2’ and ‘\u25BC’ are the two you need.

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

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Assuming you have an Email object with a @OneToOne or… May 11, 2026 at 11:09 am
  • added an answer Would a Bloom filter help? If the bit vector is… May 11, 2026 at 11:09 am
  • added an answer If you run a query with 'Show Execution Plan' switched… May 11, 2026 at 11:09 am

Related Questions

We have an external service that is currently accessible via the http (port 80,
Hey. We're building a large ASP.NET website, and have hired an external firm to
We have an SVN repository running on a Windows server, and I want to
We have an application with a good amount of jQuery JSON calls to server
We have an encryption service that we've exposed over net. tcp. Most of the
We have an SEO team at my office, and one of their dictums is
We have an InnoDB database that is about 70 GB and we expect it
We have an issue using the PEAR libraries on Windows from PHP . Pear
We have an ASP.NET application that manages it's own User, Roles and Permission database
We have an application which needs to use Direct3D. Specifically, it needs at least

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.