how to get a list of valid Iconv encodings in Ruby 1.9.1 under windows 7?
Maybe this will help:
puts Encoding.list
puts Encoding.aliases
It returns a list of loaded encodings, and a hash of encoding's aliases:
ASCII-8BIT
UTF-8
US-ASCII
Big5
CP949
Emacs-Mule
EUC-JP
EUC-KR
EUC-TW
...
{"BINARY"=>"ASCII-8BIT", "CP437"=>"IBM437", "CP737"=>"IBM737", "CP775"=>"IBM775",
"IBM850"=>"CP850", "CP857"=>"IBM857", "CP860"=>"IBM860", "CP861"=>"IBM861",
"CP862"=>"IBM862", "CP863"=>"IBM863", "CP864"=>"IBM864", "CP865"=>"IBM865", ...
The list is not maintained by Ruby so you can't do it from Ruby. Ruby simply uses whatever iconv you've installed on the system. If you have the full iconv installation, you can get the list from iconv like,
iconv /l
If you just have the library (iconv.dll), there is no way to get the list.
Most implementation is based on GNU iconv and the list is very static. You can just go to any Linux machine and type "iconv -l" to get the list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With