iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/Name.java
private static String escape(String s) {
        StringBuffer sb = new StringBuffer(s);
        for (int i = 0; i < sb.length(); i++) {
            if (sb.charAt(i) == '/' || sb.charAt(i) == '\\' || sb.charAt(i) == '.') {
                sb.insert(i, '\\');
                i++;
            }
        }
        return sb.toString();
    }
private static String escape(String s) {
        StringBuffer sb = new StringBuffer(s);
        for (int i = 0; i < sb.length(); i++) {
            if (sb.charAt(i) == '/' || sb.charAt(i) == '\\' || sb.charAt(i) == '.') {
                sb.insert(i, '\\');
                i++;
            }
        }
        return sb.toString();
    }
private static String escape ( String s ) { StringBuffer sb = new StringBuffer ( s ) ; for ( int i = 0 ; i < sb . length ( ) ; i ++ ) { if ( sb . charAt ( i ) == ' ' || sb . charAt ( i ) == ' ' || sb . charAt ( i ) == ' ' ) { sb . insert ( i , ' ' ) ; i ++ ; } } return sb . toString ( ) ; }
escape any occurrence of "/", "." and "\"
escape any occurrence of / . and \