protected int getOffset(String currentString, String newString) {
        try {
            byte[] current = currentString.getBytes();
            byte[] buf = newString.getBytes();

            if (!currentString.equals(newString)) {
                // Figure out what character starts the change.

                if (currentString.equals("")) {
                    return 0;
                } else {
                    for (int x = 0; x < current.length; x++) {
                        if (current[x] != buf[x]) {
                            return x;
                        }
                    }
                }
            } else {
                return 0;
            }

            return 0;
        } catch (Exception e) {
            return 0;
        }
    }