Domanda

I'm developing application for android and I have there greek content with diacritics. Example:

ἑ ω ρά κα μεν ἐ θε α σά με θα ἔ θνε σιν πνεῦ μα

on android (standard font) I can see only squares or empty spaces instead of symbols "ἑ", "ά", "ῦ" etc...

Does anyone know how to solve this? Should I find some custom font that supports these symbols? Something else?

È stato utile?

Soluzione

Android does not support these characters. http://code.google.com/p/android/issues/detail?id=26037

Problem is fixed in Android 4.3

Copy fonts from android 4.3 release and use as custom font in application to support old android devices.

TextView tv = (TextView) findViewById(R.id.test);
Typeface typeface = Typeface.createFromAsset(getAssets(), "custom.ttf");
tv.setTypeface(typeface);

Altri suggerimenti

Please try following

public void parse(){
    InputStream in = null;
    InputStreamReader r = null;
    BufferedReader reader = null;
    String line = null;
    try{
        in = getAssets().open("db.csv");

        reader = new BufferedReader(new InputStreamReader(in,"ISO-8859-1"));

        while( (line = reader.readLine())!= null){
               System.out.println(line);
           text.setText(text.getText().toString() + line);
            }

    reader.close();
    in.close();
    }catch (Exception e) {
         e.printStackTrace();
    }
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top