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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:27:45+00:00 2026-06-17T04:27:45+00:00

What I am trying to do is to display data coming from a mysql

  • 0

What I am trying to do is to display data coming from a mysql database into a inside a form. I get the data through an ajax call to my db manager that retrieves the data.

  • First: heres the meta tag of my page:

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

  • Second: I tried to specify the encoding in the ajax call as (I use jquery) also tried with utf8 for scriptCharset and content type charset:

    ` $('.btn-group#couleur > button').click(function(){
          $.ajaxSetup({
             async:false,
             scriptCharset: "iso-8859-1",
            contentType:"application/json; charset=iso-8859-1"
          });`
    </li>
    

  • Third: my table is built with the following SQL encoding is working fine for other table :
    `

    CREATE TABLE IF NOT EXISTS `pays` (
      `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
      `pays` varchar(30) COLLATE latin1_general_ci NOT NULL,
      PRIMARY KEY (`id`)
    ) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ;
    `
    
  • Final : Here is the html that is generated:

    `<select class="span8" name="pays">
       <option value="11">Chili</option>
       <option value="5">Espagne</option>
       <option value="4">�tats-Unis</option>
       <option value="2">France</option>
       <option value="3">Gr�ce</option>
       <option value="6">Italie</option>
       <option value="9">Nouvelle-Z�lande</option>
       <option value="7">Portugal</option>
    </select>`
    
  • Any guess as to what I might be doing wrong ?

    • 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-17T04:27:47+00:00Added an answer on June 17, 2026 at 4:27 am

      Your encoding from the database and the HTML output do not match: you tell your browser that you write UTF-8 but fetch latin1/iso-8859-1 from your database and write that directly to your <option>s fields. Ain’t gonna work.

      You have to use a conversion function like iconv(), which is probably done best in the function that fetches data from your database and pushes it to your Ajax call. Since you didn’t tell what the language is, you have to look that up yourself.

      Note: specifying contentType:”application/json; charset=utf-8″ to your Ajax call will not automagically transform the encoding, unless you have a very smart Ajax call…

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

    Sidebar

    Related Questions

    I am trying to show the data coming from mysql database as a table
    I am trying to display data that I am getting from server through json.
    I'm trying to display data from a database and I want to know what
    I am trying to get to grips with how you display data from a
    I'm trying to fix the layout of the data coming from the database in
    I'm trying to make a search form that displays data from my database where
    I'm trying to get ReportViewer to display data from a BindingSource (VB.Net Winforms). I
    I'm trying to display image data read in from a binary file (I have
    I'm trying to display some data from a list sharepoint and then using jquery
    Hi i am new to jsp & was trying to display some data from

    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.