Display the drop-down list

Test of iconv()

Example #1 : test success
Example #2 : test success
Example #3 : test success
Example #4 : test success
Example #5 : test success
Example #1
$input = [
  
=> 'UTF-8',
  
=> 'ISO-8859-1//TRANSLIT',
  
=> 'This is the Euro symbol \'€\'.',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'This is the Euro symbol \'EUR\'.',
    
'hex' => [
      
'in__charset' => '5468697320697320746865204575726f2073796d626f6c2027e282ac272e',
      
'out_charset' => '5468697320697320746865204575726f2073796d626f6c2027455552272e',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
=> 'UTF-8',
  
=> 'ISO-8859-1//IGNORE',
  
=> 'This is the British Pound symbol \'£\'.',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'This is the British Pound symbol \'\'.',
    
'hex' => [
      
'in__charset' => '5468697320697320746865204272697469736820506f756e642073796d626f6c2027c2a3272e',
      
'out_charset' => '5468697320697320746865204272697469736820506f756e642073796d626f6c2027a3272e',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
=> 'UTF-8',
  
=> 'ISO-8859-1',
  
=> 'This is the Euro symbol \'€\'.',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => false,
    
'hex' => [
      
'in__charset' => '5468697320697320746865204575726f2073796d626f6c2027e282ac272e',
      
'out_charset' => '',
    ],
  ],
  
'errors' => [
    
=> [
      
'code' => 8,
      
'message' => 'iconv(): Detected an illegal character in input string',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #4
$input = [
  
=> 'UTF-8',
  
=> 'ISO-8859-1',
  
=> 'à',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '',
    
'hex' => [
      
'in__charset' => 'c3a0',
      
'out_charset' => 'e0',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #5
$input = [
  
=> 'ISO-8859-1',
  
=> 'UTF-8',
  
=> '_DOUBLE_QUOTES_\\xe0_DOUBLE_QUOTES_',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'à',
    
'hex' => [
      
'in__charset' => 'e0',
      
'out_charset' => 'c3a0',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]