跳到主要内容
ArcBlock Community

Unable to Register Non-Latin Characters in Domain Names

JM “cryptotestnet” Morales
支持
did-spaceswont-fix

image.png

Bug Description

Users cannot register domains with non-Latin characters (e.g., Chinese characters like 区块链.did). Error:

plaintext

javascript
Error: "Please enter a valid domain name"

Steps to Reproduce

  1. Navigate to https://www.didnames.io.
  2. Attempt to register a domain with non-Latin characters (e.g., 区块链.did).
  3. 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

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

javascript
import re  
def validate_domain(domain):  
  if not re.match(r'[a-zA-Z0-9\u4e00-\u9fff]+', domain):  
    raise ValueError("Invalid domain name")  
    
    

1 条回复

wangshijun12个月前

This is a limitation by design.

回复