I am building a Soap driver to a cloud environment and i do have a lot
of trouble with charsets and getting rid of diacrites
On the first try i got the message that the received bytes were probably
B64 so i should write a ByteArrayModifiers.
While doing this i found something strange, i did not do actual decoding
but i put the reponse (byte) in a new string (UTF-8) and then put the
string back in the (byte) variable. (See code below). This actually
works an the response is readable for a driver. So no decoding, not
doing anything but putting the value in different variables. The only
thing that really happens is that the string is UTF-8.

Within this system we do have a lot of turkish people with different
dicrites (all well within UTF-8).
For some reason , as soon as the response leaves the shim, we see
caracters like ? and <?>. The first (?) is only a problem creating
names. I never met somebody who is calles ?elik.
The second (<?>, a ? in a little square) however results in a syntax
It is not possible to use a policy or script to translate these.
eDirectory is capable of storing UTF-8 (UTF-16) but this special
caracter will render into a syntax error.

Am i doing something wrong here or could the Soap response be invalid.
Is it possible that the SOAP response coantains invalid values and the
transferring between the variables solves that but introduces the
diacrites issue)

Below is the code snippet with the translations

Many thx in advance

import java.io.IOException;
import com.novell.nds.dirxml.driver.soap.util.*;

public class SoapDecoder implements ByteArrayModifiers {

static {
com.sun.org.apache.xml.internal.security.Init.init ();
private Tracer tracer;
private String encoding;

* @param bytes
* @param fromEncoding
* @param toEncoding
* @return
* @throws Base64DecodingException
private byte[] translate(byte[] bytes, String fromEncoding) {

byte[] translatedBytes;

try {
String datStr = new String(bytes,"UTF-8");
translatedBytes = datStr.getBytes();
} catch(IOException exception)
this.tracer.trace("SoapDecoder.translate(byte[], " + fromEncoding + ",
" + "): Problem with the encoding. Exception: " +
exception.getMessage(), 0);
return null;
return translatedBytes;

public byte[] modifyPublisherResponse(byte[] bytes) {
return this.translate(bytes, this.encoding);

dvandermaas's Profile: https://forums.netiq.com/member.php?userid=1956
View this thread: https://forums.netiq.com/showthread.php?t=53463