Java command to ignore Encoding

0

I have the following situation, I work with software A vehicle sales, it has the opportunity to sell and it has a media (as the customer was aware of the opportunity), in addition to store opportunities, software A receives information from a vehicle site, this sends us the media information with different encoding of software A media, then it is saved in the bank with strange characters, Display would look something like: Indicates $ Á & ; .

The site sends something like:

header("Content-Type: text/html;  charset=utf-8");

...

$cliente = new client("http://999.999.999.999/WebService", false, $host, $porta, $usuario, $senha);

$chave_json = '[{ "chaveIntegracao" : "var1_",
    "valor" : "'.$_POST["var1"].'"},
        {"chaveIntegracao" : "var2_",
        "valor" : "'.$_POST["var2"].'"},
        {"chaveIntegracao" : "var3_",
        "valor" : "'.$_POST["var3"].'"},
        {"chaveIntegracao" : "var4_",
        "valor" : "'.$_POST["var4"].'"
      }]';

$dados[interfaceJson] = $chave_json;         

$result = $cliente->call('criarEvento', $dados, 'http://.../', 'http://.../');

Is there any way to get the strange code and convert, without having to deal with every possibility of a strange character?

//transforma qualquer encoding em UTF-8
CastEncoding(vo.getMidia(),"UTF-8");
    
asked by anonymous 13.01.2016 / 18:11

1 answer

1
  

Java command to ignore Encoding

This is not how the band plays, encoding is necessary to solve how the bits of the text will be interpreted.

  

The site sends something like:

header("Content-Type: text/html;  charset=utf-8");

This means that the site is reporting that its content is using UTF-8 charset, but you need to first check if the UTF-8 PHP files will work otherwise.

    
20.01.2016 / 12:38