Problem showing accents

Problem showing accents

panuquepanuque Posts: 4Questions: 0Answers: 0
edited October 2011 in DataTables 1.8
Hello,

First of all, thanks to all those who have developed DataTables, is a great plugin and it has speeded up the job.

I am having a problem when it comes to show a table in the grid. I'm actually showing a view as I have to relate multiple tables and display different fields in each 1 of them. Specifically, I'm having a problem when displaying a field in which some values ​​have accents. These values ​​are not displayed in the grid are blank. If I run the script that generates the JSON, I get those fields to null value. Why does this happen?

Thank you.

Replies

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    > First of all, thanks to all those who have developed DataTables

    Thank you :-)

    > I am having a problem when it comes to show a table in the grid

    So a TABLE inside the TABLE that you are using for the DataTable? If you disable DataTables on the top table, does it work as you would expect?

    Allan
  • panuquepanuque Posts: 4Questions: 0Answers: 0
    Mmmmmm, do not quite understand your answer, hehe. I will try to explain better:

    I have a table with foreign keys to other tables, for example, these tables with these fields:

    customer (name, idtype) -> idtype references table 'type'
    type (id, name)

    Where 'idtype' is the foreign key to another table. Well, if the script that loads the data in the table lay the table 'client', I get everything right, with 2 fields. But I just want to show me the value of 'name' of the table type, I mean? So I tried to create a view like this:

    create view ... select c.name, t.name FROM customer c, type = t where t.id c.idType;

    After this, in the script where the data for the charge DataTables, when selecting the table, I put the name of the view (and the corresponding fields of view I want to show). Everything goes well except the fields that have accents and special characters.

    Thank you again ;)
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Ah I see - sorry. You were thinking DB tables, and I was talking HTML tables :-).

    What character encoding is your web-page, and what character encoding is your database? there might be a mismatch between the two.

    Allan
  • panuquepanuque Posts: 4Questions: 0Answers: 0
    Hi again Allan, and thank you again!

    My meta tag in the html page is:

    [code]

    [/code]

    and database encoding is

    [code]
    charset: utf8
    collation: utf8_general_ci
    [/code]

    im so confused :S

    Again thanks ;)
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Well that looks okay to me - so I'm afraid I'm not sure why this would be happening. Do all your Javascript tags also indicate that they are UTF8?

    Allan
  • GregPGregP Posts: 500Questions: 10Answers: 0
    The meta tag doesn't necessarily do anything active. If the web server isn't returning a response with the UTF-8 character set, the meta tag cannot force the character set change.

    It's not likely that the database will be an issue either. As you've already shown, it's set to use UTF-8.

    The issue could be with the interpreter (PHP or whatnot) but I don't think so. I don't know enough about interpreters to say for sure. Based on what I know about the whole web stack, it's much more likely to be the web server itself (Apache or IIS in most cases), which is the part of the stack responsible for finally packaging up the document and sending it along.
This discussion has been closed.