/*
*******************************************************************************
-* Copyright (C) 2010-2011, International Business Machines
+* Copyright (C) 2010-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
break;
}
if(toASCII) {
- // Permit an empty label at the end but not elsewhere.
- if(i==labelStart && i<(srcLength-1)) {
+ if(i==labelStart) {
addLabelError(info, Error.EMPTY_LABEL);
} else if((i-labelStart)>63) {
addLabelError(info, Error.LABEL_TOO_LONG);
/*
*******************************************************************************
-* Copyright (C) 2010-2011, International Business Machines
+* Copyright (C) 2010-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
"1234567890123456789012345678901234567890123456789012345678901",
"UIDNA_ERROR_LABEL_TOO_LONG|UIDNA_ERROR_DOMAIN_NAME_TOO_LONG" },
// hyphen errors and empty-label errors
+ { ".", "B", ".", "UIDNA_ERROR_EMPTY_LABEL" },
+ { "\uFF0E", "B", ".", "UIDNA_ERROR_EMPTY_LABEL" },
// "xn---q----jra"=="-q--a-umlaut-"
{ "a.b..-q--a-.e", "B", "a.b..-q--a-.e",
"UIDNA_ERROR_EMPTY_LABEL|UIDNA_ERROR_LEADING_HYPHEN|UIDNA_ERROR_TRAILING_HYPHEN|"+