Maybe not a bug, bug please consider to evaluate the behavior that IDN.toASCII("example.com.") does not return "example.com."(with the trailing dot), but "example.com" (the tailing dot is swallowed.