Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - The problem of getting strings in JAVA binary code String.getBytes () problem
The problem of getting strings in JAVA binary code String.getBytes () problem
Chinese characters in PHP are determined by the coding of files. Or at present, PHP strings do not support Chinese characters, and Chinese characters are regarded as the output of bytes intact. Java strings support Chinese characters, so pay attention to coding. For example, when PHP uses GBK-encoded files to communicate with java, the Java string will be str. getbytes ("GBK"); Convert into bytes and participate in coding.

In addition, it should be noted that PHP's MCrypt library has no preset completion function and key processing function.

Before AES coding, PHP should write Java-compliant code, and supplement and process the keys and data accordingly.

For example, in the AES/CBC/PKCS5Padding mode of Java, you must manually write a PKCS7 completion method in PHP.

You can communicate in Java.