• 请不要在回答技术问题时复制粘贴 AI 生成的内容
tl3shi
V2EX  ›  程序员

Conflicts between Java .net.URL and Java .net.URI when dealing with hostname contains underscore( ), is it a bug?

  •  
  •   tl3shi · May 31, 2017 · 2465 views
    This topic created in 3296 days ago, the information mentioned may be changed or developed.

    REF link

    java.net.URL url = new java.net.URL("http://test_1.tanglei.name");
    System.out.println(url.getHost()); //test_1.tanglei.name
    java.net.URI uri = new java.net.URI("http://test_1.tanglei.name");
    System.out.println(uri.getHost()); //null 
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3373 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:28 · PVG 19:28 · LAX 04:28 · JFK 07:28
    ♥ Do have faith in what you're doing.