See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

dijit.Editor doesn't display Japanese characters

General Tech Learning Aids/Tools

Max. 2000 characters



( 5 months ago )


I am using the Dojo Toolkit to build an SRS to both aid in my learning of both the Dojo Toolkit and the Japanese language.

For those of your who don't know an SRS is basically a flash card system.

So, I have a side bar where I can choose a deck of cards to review and when I click on a deck from the list it opens up a new tab in a TabContainer which contains two ContentPanes.

One ContentPane contains a DataGrid which currently uses an ItemFileWriteStore with a url to a json file.

The json file contains the items for the DataGrid with each item possesing an idquestion and answer.

The id is currently just an integer value and the question and answer both contain Japanese strings.

The idea is that when a row in the DataGrid is clicked, the ContentPane below the one containing the DataGrid should have it's contents replaced with a dijit.Editor.

The original contents of the ContentPane before they are replaced is just a simple string saying Click on the rows in the grid above to edit a card's details.

I am creating the dijit.Editor programmatically and everything works well until I try to give it a Japanese string from the DataGrid's row.

This is my JavaScript which gets the DataGrid row's information and creates the dijit.Editor:

(grid is the DataGrid object and card_details is the id of the ContentPane)

dojo.connect(grid, 'onRowClick', function(e) {
    var id = grid.getItem(e.rowIndex).id;
    var question = grid.getItem(e.rowIndex).question;
    var answer = grid.getItem(e.rowIndex).answer;

    dojo.byId('card_details').innerHTML = '';

    var editor = new dijit.Editor({
        id: 'editor',
        value: question
    }, dojo.byId('card_details'));

The code above creates the dijit.Editor in the ContentPane but doesn't fill it with the value stored in the question variable (I have logged and alerted the variable and it does contain the expected value).

However if I replace the variable with a literal string like My String or even something in Japanese like 反乱者 it works just fine.

It even works if I replace: var question = grid.getItem(e.rowIndex).question; with: var question = '反乱者';

Does anybody know why it won't work when using the question variable when it has been assigned it's value via grid.getItem(e.rowIndex).question?

I am still a beginner when it comes to Dojo Toolkit so I'm sure it must be something obvious.

Any help would be appreciated!



( 5 months ago )

I have found the answer to my question now.

It turns out I just needed to change:

var question = grid.getItem(e.rowIndex).question;


var question =, 'question');

what's your interest