title: How to load a Text file into Tmemo(Android,C++Builder)
body: <p>I use C++Builder to make an Android app.</p>
  
  <p>I try to load a text file into a <code>TMemo</code>, but there is an error:</p>
  
  <blockquote>
    <p>No mapping for the Unicode charactor exists in the target multibyte code page.</p>
  </blockquote>
  
  <p>I use <code>TDirectory::GetFiles()</code> to get a list of files and add them to a <code>TListBox</code>:</p>
  
  <pre><code>TStringDynArray list;
  TSearchOption searchOption;
  
  searchOption = TSearchOption::soAllDirectories;
  
  list = TDirectory::GetFiles(SYS_TxtDirectory, "*.txt", searchOption);
  
  ListBox1-&gt;Items-&gt;Clear();
  for(int i=0;i&lt;list.Length;i++)
  {
      ListBox1-&gt;Items-&gt;Add(list[i]);
  }
  </code></pre>
  
  <p>When I click on the ListBox, I get a filename with full path into this variable:</p>
  
  <pre><code>AnsiString txtFileName; //store txt filename with full path
  </code></pre>
  
  <p>I wish to load this file into a TMemo. But these codes cause the error:</p>
  
  <p>Code 1:</p>
  
  <pre><code>Memo1-&gt;Lines-&gt;LoadFromFile(txtFileName); //&lt;----run to here,error occurred
  </code></pre>
  
  <p>Code 2:</p>
  
  <pre><code>TStringStream * LrcFileStream;
  
  LrcFileStream=new TStringStream();
  
  LrcFileStream-&gt;LoadFromFile(txtFileName);
  
  Memo1-&gt;Lines-&gt;LoadFromStream(LrcFileStream); //&lt;----run to here,error occurred
  
  delete LrcFileStream;
  </code></pre>
  
  <p>Code 3:</p>
  
  <pre><code>TStringDynArray list;
  
  list = TFile::ReadAllLines(LrcFile); //&lt;----run to here,error occurred
  
  Memo1-&gt;Lines-&gt;Clear();
  
  for(int i=0;i&lt;list.Length;i++)
  {
      Memo1-&gt;Lines-&gt;Add(list[i]);
  }
  </code></pre>
  
  <p>Code 4:</p>
  
  <pre><code>TStringList *ss=new TStringList();
  
  ss-&gt;LoadFromFile(LrcFile); //&lt;----run to here,error occurred
  
  for(int i=0;i&lt;ss-&gt;Count;i++)
  {
      TmpStr=TmpStr+ss-&gt;Strings[i];
  }
  
  delete ss;
  </code></pre>
  
  <p>How can I load a text file into a <code>TMemo</code>?</p>