CSV Wrong Encoding UTF-8 - android

I am building an app, and I have a need for names of cities.
I have found a CSV and an XML file on this site:
https://data.gov.il/dataset/citiesandsettelments
The app is in Hebrew, and I need the database on this site.
So I downloaded the CSV file which is in UTF-8.
When I copied it into Android Studio's res/raw folder, this is the result:
You can see clearly that the English names for the cities are fine, but all others which are written in Hebrew are messed up.
What should I do to prevent this error?

Ok i found the problem
i changed the encoding into windows 1255 and it works fine.
sorry for this.

Related

Cannot read some files names from asset folder

I can read the file names from Asset folder but it is skipping the few file names
It looks like it is only able list me the names which are in English rest of the names i.e non english are skipped . I have attached a image. In image you can see the code , asset folder and Log of the list that i get .
Thanks for your help .
As far as i know, non-english characters are not allowed in filenames inside APK
renaming folder using small letter without character..
I think it's work..

Load large XML files

I have an xml file (contains images) in the file. The file size is about 50M.
When i read it in flex
on iOS it read well, no problems. Everything is ok
but on Android always it gives me error #1085.
The file and code are the same in Android and iOS.
The XML file is valid - I have tested it on XML validator.
Can anyone tell me what to do?
Check the encoding of the file... it might be that the file is saved with a different encoding on android.

localization isn't working (even with "-en" language files)

I have an android app which includes both English and Turkish(default) values and drawable files but my emulator only is working on the default one, which is Turkish now. (values and drawable-xxhdpi)
My emulator's settings:
http://i.imgur.com/wpDu5Wc.png
Here is my res folder:
http://i.imgur.com/oMTdpHW.png
So what's the problem? Why doesn't it work on English files? I'm hopeless right now.
Turns out I've written the file name wrong.
"drawable-en-xhpdi" -> "drawable-en-xhdpi" That didn't give any error.

import csv file contain arabic data to sqllite

I have an excel file with data in arabic. How can I import this in an sqlite database for use in an Android application? I tried to export as CVS, but excel doesn’t export the cvs as unicode, so the data is unreadable
Even though the question has been asked for a while now but I actually encountered the same issue and solved it by following the below steps:
Open your excel sheet (.xls or .xlsx)
Save it in Unicode Text (.txt) format
Open the text file and change the encoding to UTF-8
Replace the delimiter (which could be Tab delimited) by a comma
Make sure the file is readable and as you expect it to be (you might need a minor manual modification in some cases)
Rename the file back to (.csv)

4 MB .txt file in android application

I have a really big .txt file ( 4.2MB) that I have to access in my android application. It consists of words and their definitions in this format:
word - definition
word2 - definition2
Should I put this file in /assets folder or in res/raw? Or something third? Maybe I should put it on SD card because of its size?
And how should I get file contents in the code?
I have tried both assets and res/raw, but the file size always seems to be the problem or I am doing something wrong.
A SQLLite database could be used for this.
An example of this can be found in the latest android SDK. http://developer.android.com/resources/samples/SearchableDictionary/index.html
Putting it in raw folder would be a better idea according to me.
since putting in the SDCard would make it available to user also, and the user might screw up your database.

Categories

Resources