jQWidgets Forums

jQuery UI Widgets Forums Grid Accented Characters

This topic contains 6 replies, has 3 voices, and was last updated by  Peter Stoev 12 years, 5 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Accented Characters #12481

    GDufresne
    Participant

    Hi!

    I have a small MySQL db.

    Some fields contain accented characters. I want to use jqW Grid to display a table, but every entry that contains an accented character is left blank.

    What should I do.

    TIA
    Georges

    Accented Characters #12483

    Peter Stoev
    Keymaster

    Hi GDufresne,

    Thanks for writing.

    Please include the following information in your post:

    – jQuery version, jQWidgets version, device type(PC, Mobile), browser name and version.
    – Please, provide step by step instructions on how to reproduce the reported issue and sample code which demonstrates it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Accented Characters #12487

    GDufresne
    Participant

    Sorry. Thanks for a so rapid answer.

    Using:

    jquery-1.8.2.min.js
    jQWidgets ver. 2.5.5 – personal use

    Server: localhost via TCP/IP
    Server version: 5.1.48-community
    Protocol version: 10

    User: root@localhost
    MySQL charset: UTF-8 Unicode (utf8)

    Apache/2.2.15 (Win32) PHP/5.3.2
    MySQL client version: mysqlnd 5.0.7-dev – 091210 – $Revision: 294543 $
    PHP extension: mysql

    On a PC with IE9
    ===============================================
    Here is the SQL code to generate the table:
    SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”;

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;

    CREATE TABLE IF NOT EXISTS `ajax_example` (
    `ae_name` varchar(50) NOT NULL,
    `ae_age` int(11) NOT NULL,
    `ae_sex` varchar(1) NOT NULL,
    `ae_wpm` int(11) NOT NULL,
    PRIMARY KEY (`ae_name`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    INSERT INTO `ajax_example` (`ae_name`, `ae_age`, `ae_sex`, `ae_wpm`) VALUES
    (‘Regis Philbin’, 75, ‘m’, 44),
    (‘Frank Furt’, 45, ‘m’, 87),
    (‘Jill Hill’, 22, ‘f’, 72),
    (‘Tracy Sax’, 27, ‘f’, 0),
    (‘Amélie Barker’, 35, ‘f’, 90),
    (‘Blake Black’, 54, ‘m’, 30),
    (‘Jack Black’, 30, ‘m’, 20),
    (‘Martina White’, 14, ‘f’, 114),
    (‘Martin White’, 41, ‘m’, 32),
    (‘Jason Biggs’, 23, ‘m’, 4),
    (‘Colin Smith’, 21, ‘m’, 50),
    (‘Joséphine Baker’, 45, ‘f’, 60),
    (‘Léo Bélanger’, 21, ‘m’, 80);

    ==========================================

    Here is the data.php file
    $row[‘ae_name’],
    ‘ae_age’ => $row[‘ae_age’],
    ‘ae_sex’ => $row[‘ae_sex’],
    ‘ae_wpm’ => $row[‘ae_wpm’],
    );
    }

    echo json_encode($applicants);
    ?>

    =============================================
    and the index.php file

    $(document).ready(function () {
    // prepare the data
    var source ={
    datatype: “json”,
    datafields: [{ name: ‘ae_name’ },{ name: ‘ae_age’ },{ name: ‘ae_sex’ },{ name: ‘ae_wpm’ }],
    url: ‘data.php’
    };
    $(“#jqxgrid”).jqxGrid({
    source: source,
    theme: ‘classic’,
    columns: [{ text: ‘Name’, datafield: ‘ae_name’, width: 100 },{ text: ‘Age’, datafield: ‘ae_age’, width: 100 },{ text: ‘Sex’, datafield: ‘ae_sex’, width: 50 },{ text: ‘WordsPerMinute’, datafield: ‘ae_wpm’, width: 160 }]
    });
    });

    =======================================

    Hope this helps.

    Many thanks

    Georges
    Hope this helps.

    Accented Characters #12492

    Peter Stoev
    Keymaster

    Hi Georges,

    I would need additional info. Could you please post, the JSON returned from the server or if it is a private information, you can send it or part of it to support@jqwidgets.com. I would like to test with the data which is actually not displayed.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Accented Characters #12530

    GDufresne
    Participant

    Hi!

    I am new to jQuery so I don’t know how to post you the JSON, but I think the problem is character encoding. I used the utf8_encode function
    ( ‘ae_name’ => utf8_encode($row[‘ae_name’])

    and the problem seems to be fixed. But I don’t know yet what will happen when I will want to save data to mYSQL.

    By the way, the “data.php” file I sent you is corrupted. The good one is as follows:

    $row[‘ae_name’],
    ‘ae_age’ => $row[‘ae_age’],
    ‘ae_sex’ => $row[‘ae_sex’],
    ‘ae_wpm’ => $row[‘ae_wpm’],
    );
    }

    echo json_encode($applicants);
    ?>

    Have a good day,

    Georges

    Accented Characters #12625

    RavikumarR
    Member

    Hi dude ,
    i faced the grid display issue , remove the enter character in any column . this character not supported . replace that character and use the grid will bind .

    Accented Characters #12633

    Peter Stoev
    Keymaster

    Hi RavikumarR,

    If you report an issue regarding our products, please include the following information in your post:

    – jQuery version, jQWidgets version, device type(PC, Mobile), browser name and version.
    – Please, provide step by step instructions on how to reproduce the reported issue and sample code which demonstrate the behavior.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.