1

Here is a live example of what I am talking about: http://185.112.249.77:9999/Api/search?search=ж

That URL displays no results.

http://188.226.217.48:8338/api/clan_search/ж

It does display results.

How come this is happening?

My code for reading the parameter is: String search = request.getParameter("search");

System.out.println(search); also outputs a

?

I looked around and it seems there might be something I need to do in the Tomcat8 Config but I can't find what or figure out what has to be done.

I'd appreciate any help with this.

This problem also occurs when I am printing out the results. The first one shows no results and the 2nd shows the results and in UTF-8.

What is the most likely issue causing this and what code/config files would you need to see?

EDIT

I am receiving a bytearray which I am converting to an inputstream via a bytearrayinputstream like this. InputStream myis = new ByteArrayInputStream(decryptedPayload);

I have a class which handles the packet and it extends a class I made called PacketInputStream. This class has a readString function which goes like this:

    public String readString() throws IOException {
        int length = readVarInt();
        byte[] data = new byte[length];
        readFully(data);
        return new String(data, UTF8);
    }

The string doesn't display properly on the returned byte[]s and it also doesn't work when I send it through a GET parameter.

Thanks

  • Possible duplicate of [How to get UTF-8 working in Java webapps?](http://stackoverflow.com/questions/138948/how-to-get-utf-8-working-in-java-webapps) –  Oct 18 '15 at 11:54
  • Tomcat8 generally defaults to UTF-8, unless you are using it in compliance mode. However, Spring for example defaults to ISO-8859-1. Which kind of application you have? Also, System.out.println is a different thing altogether. – eis Oct 18 '15 at 11:59
  • @eis it is an API that sends a packet to the server and then parses the reply from the byte[]. –  Oct 18 '15 at 12:20
  • I have updated my question @RC. –  Oct 18 '15 at 12:46
  • anyone have any ideas? –  Oct 18 '15 at 14:19
  • I have had a deeper look into this and it is still confusing me. If anyone has skype then please Skype me on shivampaw12 so we can look at the source code as well. Meanwhile if anyone has any ideas on how to fix this it would be GREATLY appreciated. –  Oct 18 '15 at 17:05
  • Anyone??????????????? –  Oct 20 '15 at 18:00

0 Answers0