PHP replacing special characters like à->a, è->e

There’s a much easier way to do this, using iconv – from the user notes, this seems to be what you want to do: characters transliteration // PHP.net User notes <?php $string = “ʿABBĀSĀBĀD”; echo iconv(‘UTF-8’, ‘ISO-8859-1//TRANSLIT’, $string); // output: [nothing, and you get a notice] echo iconv(‘UTF-8’, ‘ISO-8859-1//IGNORE’, $string); // output: ABBSBD echo iconv(‘UTF-8’, … Read more

How to decode a string encoded with openssl aes-128-cbc using java?

Solved it using Bouncy Castle library. Here is the code: package example; import java.util.Arrays; import org.apache.commons.codec.binary.Base64; import org.bouncycastle.crypto.BufferedBlockCipher; import org.bouncycastle.crypto.CipherParameters; import org.bouncycastle.crypto.InvalidCipherTextException; import org.bouncycastle.crypto.engines.AESEngine; import org.bouncycastle.crypto.generators.OpenSSLPBEParametersGenerator; import org.bouncycastle.crypto.modes.CBCBlockCipher; import org.bouncycastle.crypto.paddings.BlockCipherPadding; import org.bouncycastle.crypto.paddings.PKCS7Padding; import org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher; public class OpenSSLAesDecrypter { private static final int AES_NIVBITS = 128; // CBC Initialization Vector (same as cipher block size) [16 … Read more

Base64 Java encode and decode a string [duplicate]

You can use following approach: import org.apache.commons.codec.binary.Base64; // Encode data on your side using BASE64 byte[] bytesEncoded = Base64.encodeBase64(str.getBytes()); System.out.println(“encoded value is ” + new String(bytesEncoded)); // Decode data on other side, by processing encoded data byte[] valueDecoded = Base64.decodeBase64(bytesEncoded); System.out.println(“Decoded value is ” + new String(valueDecoded)); Hope this answers your doubt.