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 8980483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:05:58+00:00 2026-06-15T20:05:58+00:00

I’ve got an Array in a javascript file that contains Hungarian first names with

  • 0

I’ve got an Array in a javascript file that contains Hungarian first names with with special letters like: ö ő ó á í.

var names = ["Aba", "Abád", "Abbás", "Abdiás", "Abdon", "Ábel", "Abelárd"];

(The above is just a shortened array, the whole length is around 3000 item long)

When I want to output the content of “names” in a HTML document I got muffled letters for the non ASCII chars.

If I define the array straight in the UTF-8 encoded HTML where it is outputted I got a clear output list. Where as if I define the array in a JavaScript file I got a muffled content.
See the screen: http://screencast.com/t/YJ83K9Mgm

I detected (Notepad++) that the JavaScript file is in ANSI coding.

QUESTION: how can I store the name array (or code containing this special letters in general) so that I can output it in the browsers properly.

(Actually I am using MS Studio Express 2012 for coding. I could not find a place where I can set the coding type of certain files.)

HERE IS THE SIMPLIFIED CODE WIDTH THE ARRAY DEFINED IN THE HTML HEADER:

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>Name List Trial</title>
    <script src="nevekdata.js"></script>
    <script>
        // These are Hungarian first names just a few of them, the whole array is around 1400 long
        // including letters like ö ő ó á stb.
        // !!!!!!!!
        // if I difine  the "names" Array here, the array list is written out in the browser width the
        // special letter seen correctly.        
        var names = ["Aba", "Abád", "Abbás", "Abdiás", "Abdon", "Abdullah", "Ábel", "Abelárd"];
        // if I put it into a javascript file "nevekdata.js" I get muffled chars instead of the correct letters
        function writeOutNames() {
            outputnames.innerHTML = names.toString();
        }
    </script>
</head>
<body>
    <button onclick="writeOutNames()">Write Out names</button>
    <p></p>
    <p id="outputnames"></p>

</body>
</html>
  • 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-15T20:05:59+00:00Added an answer on June 15, 2026 at 8:05 pm

    You already said it yourself, the file is saved in ANSI, but then you serve it as UTF-8. This causes browser to treat your ANSI encoded file as UTF-8.

    The charset parameters and headers are just a hint to the browser of what encoding your files are in, it doesn’t actually do anything to the “physical” bytes of the file. For this all to work, you need the charset parameter and headers AND encode your file physically to UTF-8 bytes.

    You need to encode the file as UTF-8.. in notepad++, save the file as UTF-8 without BOM.

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I need a function that will clean a strings' special characters. I do NOT
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.