java - Android String.format locale set explicitly to US but Persian numbers are used for Integer -


the title explains all.

string method = string.format(             "select studymap.id,studymap.title,studymap.zorder,studymap.hierarchy_id,studymap.book_id," +                     "studymap.abstract,studymap.type,studymap.free_view,studymap.localpath,studymap.flags," +                     "studymap.visit_status,downloads.status download_status,downloads.studymap_id,studymap.publish_status "+                     "from studymap left join downloads on studymap.id = downloads.studymap_id" +                     " studymap.book_id = %d order studymap.zorder", book.id); 

book.id integers, still error on devices:

android.database.sqlite.sqliteexception: no such column: ۵۴۵ (code 1): , while compiling: select studymap.id,studymap.title,studymap.zorder,studymap.hierarchy_id,studymap.book_id,studymap.abstract,studymap.type,studymap.free_view,studymap.localpath,studymap.flags,studymap.visit_status,downloads.status download_status,downloads.studymap_id,studymap.publish_status,hierarchy.is_owned studymap left join downloads on studymap.id = downloads.studymap_id left join hierarchy on hierarchy.id = studymap.hierarchy_id studymap.hierarchy_id = ۵۴۵ order studymap.zorder @ com.nemo.kaman_android.core.ag.run(sqlitekit.java:303) 

sqlitekit.java(303):

cursor cursor = kamandatabase.rawquery(query, null); 

i set applications default locale in myapplication.java

locale locale = new locale(locale.english.getlanguage());     locale.setdefault(locale);     configuration config = new configuration();     config.locale = locale;     getbasecontext().getresources().updateconfiguration(config,             getbasecontext().getresources().getdisplaymetrics()); 

but these aren't enough apparently

i building queries while ago:

"select sum(badge) ... " + year_filter + ... 

and crashing same errors on devices. after using format, of calls gets fixed , don't. don't know what i'm thinking.

edit 2: thought maybe put utf8 persian character in middle of query somewhere makes integers come persian, can see in crash logs, same kind of exceptions happen on different queries on different devices, can't put together, 1 of devices has default "farsi" locale , other "en", @ least thats acralyzer thinks have.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -