< prev index next >

src/java.base/share/classes/java/net/IDN.java

Print this page




 390                 if (toASCIIOut.equalsIgnoreCase(dest.toString())) {
 391                     // step 8
 392                     // return output of step 5
 393                     return decodeOut.toString();
 394                 }
 395             } catch (Exception ignored) {
 396                 // no-op
 397             }
 398         }
 399 
 400         // just return the input
 401         return label;
 402     }
 403 
 404 
 405     //
 406     // LDH stands for "letter/digit/hyphen", with characters restricted to the
 407     // 26-letter Latin alphabet <A-Z a-z>, the digits <0-9>, and the hyphen
 408     // <->.
 409     // Non LDH refers to characters in the ASCII range, but which are not
 410     // letters, digits or the hypen.
 411     //
 412     // non-LDH = 0..0x2C, 0x2E..0x2F, 0x3A..0x40, 0x5B..0x60, 0x7B..0x7F
 413     //
 414     private static boolean isNonLDHAsciiCodePoint(int ch){
 415         return (0x0000 <= ch && ch <= 0x002C) ||
 416                (0x002E <= ch && ch <= 0x002F) ||
 417                (0x003A <= ch && ch <= 0x0040) ||
 418                (0x005B <= ch && ch <= 0x0060) ||
 419                (0x007B <= ch && ch <= 0x007F);
 420     }
 421 
 422     //
 423     // search dots in a string and return the index of that character;
 424     // or if there is no dots, return the length of input string
 425     // dots might be: \u002E (full stop), \u3002 (ideographic full stop), \uFF0E (fullwidth full stop),
 426     // and \uFF61 (halfwidth ideographic full stop).
 427     //
 428     private static int searchDots(String s, int start) {
 429         int i;
 430         for (i = start; i < s.length(); i++) {




 390                 if (toASCIIOut.equalsIgnoreCase(dest.toString())) {
 391                     // step 8
 392                     // return output of step 5
 393                     return decodeOut.toString();
 394                 }
 395             } catch (Exception ignored) {
 396                 // no-op
 397             }
 398         }
 399 
 400         // just return the input
 401         return label;
 402     }
 403 
 404 
 405     //
 406     // LDH stands for "letter/digit/hyphen", with characters restricted to the
 407     // 26-letter Latin alphabet <A-Z a-z>, the digits <0-9>, and the hyphen
 408     // <->.
 409     // Non LDH refers to characters in the ASCII range, but which are not
 410     // letters, digits or the hyphen.
 411     //
 412     // non-LDH = 0..0x2C, 0x2E..0x2F, 0x3A..0x40, 0x5B..0x60, 0x7B..0x7F
 413     //
 414     private static boolean isNonLDHAsciiCodePoint(int ch){
 415         return (0x0000 <= ch && ch <= 0x002C) ||
 416                (0x002E <= ch && ch <= 0x002F) ||
 417                (0x003A <= ch && ch <= 0x0040) ||
 418                (0x005B <= ch && ch <= 0x0060) ||
 419                (0x007B <= ch && ch <= 0x007F);
 420     }
 421 
 422     //
 423     // search dots in a string and return the index of that character;
 424     // or if there is no dots, return the length of input string
 425     // dots might be: \u002E (full stop), \u3002 (ideographic full stop), \uFF0E (fullwidth full stop),
 426     // and \uFF61 (halfwidth ideographic full stop).
 427     //
 428     private static int searchDots(String s, int start) {
 429         int i;
 430         for (i = start; i < s.length(); i++) {


< prev index next >