--- a/lib/net/url.lua
+++ b/lib/net/url.lua
@@ -340,7 +340,7 @@ function M:setAuthority(authority)
 				self.password = v
 				return ''
 		end)
-		if string.find(userinfo, "^[%w%+%.]+$") then
+		if string.find(userinfo, "^[%p%w%+%.]+$") then
 			self.user = userinfo
 		else
 			-- incorrect userinfo
@@ -369,7 +369,7 @@ function M.parse(url)
 		comp.fragment = v
 		return ''
 	end)
-	url =url:gsub('^([%w][%w%+%-%.]*)%:', function(v)
+	url =url:gsub('^([%w][%w%+%-%_%.]*)%:', function(v)
 		comp.scheme = v:lower()
 		return ''
 	end)
