title: â® characters getting converted to question marks while getting back
body: <p>I am having a very weird issue.
  I am putting and getting messages from Amazon AWS SQS.
  While putting I am compressing and encoding the messages, like this :</p>
  
  <pre><code>String responseMessageBodyOriginal = gson.toJson(responseData);
  String responseMessageBodyCompressed = compressToBase64String(responseMessageBodyOriginal);
  AmazonSqsHelper.sendMessage(responseMessageBodyCompressed, queue, null);
  </code></pre>
  
  <p>Compression and encoding function, looks like this :</p>
  
  <pre><code>public static String compressToBase64String(String data) throws IOException {
      ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length());
      GZIPOutputStream gzip = new GZIPOutputStream(bos);
      gzip.write(data.getBytes());
      gzip.close();
      byte[] compressedBytes = bos.toByteArray();
      bos.close();
      return new String(Base64.encodeBase64(compressedBytes));
  }
  </code></pre>
  
  <p>On the other hand, while receiving message, this is the code : </p>
  
  <pre><code>List&lt;Message&gt; sqsMessageList = AmazonSqsHelper.receiveMessages(queueUrl, max_message_read_count,
                      default_visibility_timeout);
  int num_messages = sqsMessageList.size();
  if (num_messages &gt; 0) {
     for (Message m : sqsMessageList) {
         String responseMessageBodyCompressed = m.getBody();
         String responseMessageBodyOriginal = decompressFromBase64String(responseMessageBodyCompressed);
     }
  }
  </code></pre>
  
  <p>And the function used for decoding and unzipping is like this : </p>
  
  <pre><code>public static String decompressFromBase64String(String compressedString) throws IOException {
      byte[] compressedBytes = Base64.decodeBase64(compressedString);
      ByteArrayInputStream bis = new ByteArrayInputStream(compressedBytes);
      GZIPInputStream gis = new GZIPInputStream(bis);
      BufferedReader br = new BufferedReader(new InputStreamReader(gis, "UTF-8"));
      StringBuilder sb = new StringBuilder();
      String line;
      while ((line = br.readLine()) != null) {
          sb.append(line);
      }
      br.close();
      gis.close();
      bis.close();
      return sb.toString();
  }
  </code></pre>
  
  <p>But the problem is , at times if I pass characters like "<strong>â®</strong>" then those are getting converted to ???? ,  after decoding if I am printing the message.</p>
  
  <p>Not able to figure out why encoding and decoding is behaving weird. Any help would be appreciated.</p>