title: UTF-8 to CP864 (arabic) conversion
body: <p>I have the following task: some text in mixed latin/arabic written in UTF-8 needs to be converted for printing using POS-printer, which uses ancient <a href="http://en.wikipedia.org/wiki/Code_page_864" rel="nofollow">one-byte code page 864</a>.</p>
  
  <p><code>text.getBytes("ibm-864")</code> suddenly shows many question marks instead of arabic characters, and after digging the code I understood that conversion table has some different versions of arabic characters used to map to ibm-864 (somewhere in the FExx range rather than 06xx, which I have in my text).</p>
  
  <p>I'm looking for some code or library, which can convert arabic unicode to cp864, preferrably mapping to the corresponding forms of arabic chars (in cp864 there're isolated, initial, medial and final forms for some chars), and maybe even handling reverse for RTL, because I doubt that hardware supports it automatically.</p>
  
  <p>I understand that this is very specific task, but why don't give it a try? Also I know how to implement this, but trying to find a ready-to-use bicycle :)</p>
  
  <p>Anyone?</p>
  
  <p>Another possible solution: library that can translate unicode arabic from the  range <code>U+0600 - U+06FF Arabic</code> to the range <code>U+FE70 - U+FF6F Arabic Presentation Forms-B</code>. Then I can safely get my bytes in cp864. Have anyone seen anything alike?</p>