I have text to display in Latin. When text files are displayed in TextView, small diamonds with question marks in them appear where all letters should be with emphasis on them. Can anyone help? I need to be able to display text, as in PDF. So I got my text files by copying sections of text from PDF and into text files. The code viewing the text files is as follows:
public String inputStreamToString(InputStream is) throws IOException { StringBuffer sBuffer = new StringBuffer(); BufferedReader dataIO = new BufferedReader(new InputStreamReader (is)); String strLine = null; while ((strLine = dataIO.readLine()) != null) { sBuffer.append(strLine + "\n"); } dataIO.close(); is.close(); return sBuffer.toString(); }
then in onCreate () i have this:
text = (TextView)findViewById(R.id.textView1); //text.setText("This is a whole lot of text and praying"); InputStream iFile = getResources().openRawResource(idEng); try { text.setText(inputStreamToString(iFile)); text.setFocusable(false); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } text.setMovementMethod(new ScrollingMovementMethod()); ELswitch = (ToggleButton)findViewById(R.id.toggleButton1); ELswitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { // TODO Auto-generated method stub if(isChecked==true) { InputStream iFile = getResources().openRawResource(idLat); System.out.println(R.raw.sunday_compline_english); try { text.setText(inputStreamToString(iFile)); text.setFocusable(false); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { InputStream iFile = getResources().openRawResource(idEng); try { text.setText(inputStreamToString(iFile)); text.setFocusable(false); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } });
A toggle button allows the user to switch between English and Latin. The problem is that the Latin language looks like this (all letters with accents are replaced by the odd question symbol): 
Is this a problem with text files? Should I work directly from PDF? If anyone has any ideas, I am very grateful for the help. Thanks!
source share