Unable to Register Non-Latin Characters in Domain Names

Bug Description
Users cannot register domains with non-Latin characters (e.g., Chinese characters like 区块链.did).
Error:
plaintext
Error: "Please enter a valid domain name"
Steps to Reproduce
- Navigate to https://www.didnames.io.
- Attempt to register a domain with non-Latin characters (e.g.,
区块链.did). - Observe the error: "Please enter a valid domain name".
Expected Behavior
- Users should be able to register domains with Unicode characters (e.g., Chinese characters).
Actual Behavior
- Registration fails with "Please enter a valid domain name" for non-Latin characters.
Suggested Fix
Frontend Fix
Update validation to allow Unicode characters:
javascript
// Allow Unicode characters in domain input
const isValidDomain = (domain) => {
return /^[a-zA-Z0-9\u4e00-\u9fff]+/.test(domain);
}
Backend Fix
Update server-side validation to allow Unicode characters:
python
import re
def validate_domain(domain):
if not re.match(r'[a-zA-Z0-9\u4e00-\u9fff]+', domain):
raise ValueError("Invalid domain name")
1 reply
This is a limitation by design.