4848N/A/*
4848N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
4848N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4848N/A *
4848N/A * This code is free software; you can redistribute it and/or modify it
4848N/A * under the terms of the GNU General Public License version 2 only, as
4848N/A * published by the Free Software Foundation.
4848N/A *
4848N/A * This code is distributed in the hope that it will be useful, but WITHOUT
4848N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4848N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4848N/A * version 2 for more details (a copy is included in the LICENSE file that
4848N/A * accompanied this code).
4848N/A *
4848N/A * You should have received a copy of the GNU General Public License version
4848N/A * 2 along with this work; if not, write to the Free Software Foundation,
4848N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4848N/A *
4848N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4848N/A * or visit www.oracle.com if you need additional information or have any
4848N/A * questions.
4848N/A */
4848N/A
4848N/A/**
4848N/A * @test
4848N/A * @bug 6961765
4848N/A * @summary Double byte characters corrupted in DN for LDAP referrals
4848N/A */
4848N/A
4848N/Aimport com.sun.jndi.ldap.LdapURL;
4848N/A
4848N/Apublic class LdapUnicodeURL {
4848N/A public static void main(String[] args) throws Exception {
4848N/A // First 3 characters of the CJK Unified Ideographs
4848N/A String uid = "uid=\u4e00\u4e01\u4e02";
4848N/A LdapURL ldURL = new LdapURL("ldap://www.example.com/" + uid);
4848N/A if (!ldURL.getDN().equals(uid)) {
4848N/A throw new Exception("uid changed to " + ldURL.getDN());
4848N/A }
4848N/A }
4848N/A}