/*
 * Copyright 2002-2011 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package ch.ralscha.extdirectspring.demo;

import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;

import org.springframework.http.HttpInputMessage;
import org.springframework.http.MediaType;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.util.FileCopyUtils;

public class MyStringHttpMessageConverter extends StringHttpMessageConverter {
	
	@Override
	protected String readInternal(Class clazz, HttpInputMessage inputMessage) throws IOException {
		Charset charset = getContentTypeCharset(inputMessage.getHeaders().getContentType());
		String s = FileCopyUtils.copyToString(new InputStreamReader(inputMessage.getBody(), charset));
		return new String(s.getBytes(charset));
	}

	private Charset getContentTypeCharset(MediaType contentType) {
		if (contentType != null && contentType.getCharSet() != null) {
			return contentType.getCharSet();
		}
		return DEFAULT_CHARSET;
	}

}

@@ -1045,16 +1045,83 @@
 ter %7B%0A%09%0A
+%09 private static final Charset UTF_8 = Charset.forName(%22UTF-8%22);%0A%09%0A
 %09@Overri
@@ -1438,24 +1438,31 @@
 tes(charset)
+, UTF_8
 );%0A%09%7D%0A%0A%09priv

trying to fix the encoding problem