0

In arcgis java script API, I am querying the database. Everything works fine when you search numbers and English text but not Unicode characters. I know in order to query Unicode characters in SQL you have to add the N prefix as with NAME =N' امنیتی' so that the query will return the result. How can I achieve this in JavaScript the arcgis api? Below is the Find task code:

//FIND TASK SEARCH AND RESULTS
function execute(searchType, searchText as ) {
    esri.show(loading);
    findParams.searchText = searchText;
    findTask.execute(findParams, callBack);
    dijit.byId('tabContainer').selectChild(dijit.byId('dataTab'));
    map.centerAndZoom(center, zoom);
}
5
  • What errors do you get?
    – Ben Smith
    Jun 23, 2014 at 23:34
  • I don't get any error, the result set is empty.
    – johnny
    Jun 24, 2014 at 11:46
  • Ok, so after writing my answer, I read (skimmed) this article, and thought I should check - if you open developer tools, are you emitting appropriate characters?
    – Jeff
    Jun 27, 2014 at 8:48
  • yes, I cant see that character in developer tool and there is no way to attach it with json request. I will get more info from esri and update it here.
    – johnny
    Jun 27, 2014 at 15:46
  • When load your js file, please try charset, for example charset="iso-8859-1"
    – John Jin
    Jun 29, 2014 at 22:33

2 Answers 2

0

If you're sure that there should be results, and it's not working, I don't believe that there's anything you can do to make it. Certainly there is no way for you to force the SQL engine on their side to query via Unicode.

I recommend heading to the Esri Support page and raising a ticket with them, as it's likely an incorrect cast or something like that that's been overlooked somewhere.

This is all assuming that you have no access to the server that you're querying against - if you do, then please show us some code/anything at all from that.

1
  • thanks, I am in contact with ESRI lets see what they think about it. I think FindTask is not supporting this scenario and looks like QueryTask does.
    – johnny
    Jun 27, 2014 at 15:45
0

Please try to set charset properly when you load your js file, for example charset="iso-8859-1"

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.