1

I'm not sure what do do about this one. My app needs to have Loation support (Laos) - the locale is not in Android and not available in any locale packs. Although I did find a Laos Language Pack, but installing it didn't seem to change anything.

I am just trying to get a simple textview to display the correct text. When I use the Loation word like "ສະບາຍດີ", I get just boxes.

In the following - the setting of the locale works, and I have the strings.xml file in values-lo, values-en, etc. I tried this with chinese and english, and it seems to work fine for both languages - but this Laos thing is not cooperating.

    Locale locale = new Locale("lo"); 
    Locale.setDefault(locale);
    Configuration config = new Configuration();
    config.locale = locale;
    getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());

    setContentView(R.layout.activity_main);

    textView =  (TextView)findViewById(R.id.editText);

    Typeface myTypeface = Typeface.createFromAsset(getAssets(), "TAW107.TTF");

    textView.setTextSize(40);
    textView.setTypeface(myTypeface); 
    textView.setText(getString(R.string.hello_world));   /this gives boxes for "ສະບາຍດີ"
hippietrail
  • 15,848
  • 18
  • 99
  • 158

1 Answers1

1

I figured this one out. The Font set I was using did not have Laos character support. Even the font set was a "Laotion Font" set. Go figure. There are a few font families with broad support - like DejaVuSans. I used that one in the above code and it worked fine.

problem solved. - always check your fonts in things like font-manager and check the character map.

the above code works now including the localization