c# - get all Text Encoding in universal windows app -


i want make windows application convert text encoding of txt file. need text encoding supported windows. encoding.getencodings() method not exist in universal windows apps. try encoding codepage, , code:

        list<string> list = new list<string>();         list<string> errors = new list<string>();         int[] code_page = { 0, 1200, 1201, 1252, 10003, 10008, 12000, 12001, 20127, 20936, 20949, 28591, 28598, 38598, 50220, 50221,         50222, 50225, 50227, 51932, 51936, 51949, 52936, 57002, 57003, 57004, 57005, 57006, 57007, 57008, 57009, 57010, 57011, 65000, 65001 };         (int = 0; < code_page.length; i++)         {             try             {                 list.add(encoding.getencoding(code_page[i]).encodingname);             }             catch (exception ex) { errors.add(code_page[i] + "\t\t" + ex.message); }         }         } 

and have result:

first list (encoding)

  • unicode (utf-8)
  • unicode
  • unicode (big-endian)
  • unicode (utf-32)
  • unicode (utf-32 big-endian)
  • us-ascii
  • western european (iso)
  • unicode (utf-7)
  • unicode (utf-8)

errors list

  • 37___no data available encoding 37. information on defining custom encoding, see documentation encoding.registerprovider method.
  • 437__no data available encoding 437. information on defining custom encoding, see documentation encoding.registerprovider method.
  • 500__no data available encoding 500. information on defining custom encoding, see documentation encoding.registerprovider method.
  • ...etc

and question there way windows text encoding.

thank you.


Comments