0

I have two questions regarding codepages on linux.

  1. Is there any way to list out all the combination of codepages conversions possible on linux.

  2. If i have a file with data encoded in some format(say encode-1), i can use "iconv -f encode-1 -t encode-2 file > file1.txt" to encode it into encode-2 format. This way i can check conversion from encode-1 to encode-2 is possible. But for this to test i need to have some file already encoded in encode-1 format. Is there any way to test whether a particular conversion is possible without having any file already encoded with format encode-1.

1 Answers1

0

You seem to be using iconv. To get the list of all possible encodings, just run

iconv -l

If you do not have any file in a given encoding, you can create one: take any file in a known encoding and use iconv to convert it into the given encoding. If you are worried the conversion can exit in the middle, use

iconv -c

It omits invalid characters in the output, but encodes everything it can.

choroba
  • 231,213
  • 25
  • 204
  • 289
  • iconv -l will list all the codepages known to iconv but my requirement is to find all possible converstion combination. Again my second requirement is to get encodings in different LANG. If i have something in ascii with lang=en_US, how can i format it to some codepages with lang=ja_jp – Manish Sharan Singh Jul 30 '13 at 11:17
  • @ManishSharanSingh: I do not understand. Give examples, please. – choroba Jul 30 '13 at 12:36