A simple code below to do currency conversion copied from QuantLib-Python Documentation. This is failing in the EUR to GBP conversion (in the last line of code). Thank you for looking into this. The ERROR message is-
UnicodeEncodeError: 'utf-8' codec can't encode character '\udca3' in position 0: surrogates not allowed
import QuantLib as ql
usd = ql.USDCurrency()
eur = ql.EURCurrency()
gbp = ql.GBPCurrency()
usdToeur = ql.ExchangeRate(eur, usd, 1.18)
gbpToeur = ql.ExchangeRate(eur, gbp, 0.85)
m_usd = 5 * usd
m_eur = 4.39 * eur
print( 'Converting from USD: ', m_usd, ' = ', usdToeur.exchange(m_usd))
print( 'Converting from EUR: ', m_eur, ' = ', usdToeur.exchange(m_eur))
print(usdToeur.source())
print(usdToeur.target())
print(usdToeur.rate())
print(gbpToeur.source())
print(gbpToeur.target())
print(gbpToeur.rate())
optNotional = 1000000 *eur
print(optNotional)
print(usdToeur.exchange(optNotional))
print(gbpToeur.exchange(optNotional))