Fixed getting default encoding in get_system_username

Refs #19933.