The problem was due to marketcheck using DataInputStream.readLine(), which is a fundamentally broken function and has been deprecated since Java 1.1. Strings in Java consist of Unicode characters, not bytes.