added export function. better support for unicode