Heavy-flavour hadronization in pp and heavy ion collisions at the LHC