Not everything in a papal encyclical is spoken ex cathedra. Thus, not everything in there carries that type of infallibility. Of course, a papal encyclical can be reiterating things that have been spoken on a previous occasion, and so those things could be infallible on account of the previous occasion. Furthermore, there are other types of infallibility besides the ex cathedra kind. So that previous occasion could be from a council, for example, and not from an ex cathedra statement.
So, you need more information than that the statement is contained in a papal encyclical. Here is a cut from the Catechism of the Catholic Church where you can begin to read about this issue:
891 “The Roman Pontiff, head of the college of bishops, enjoys this infallibility in virtue of his office, when, as supreme pastor and teacher of all the faithful - who confirms his brethren in the faith he proclaims by a definitive act a doctrine pertaining to faith or morals. . . . The infallibility promised to the Church is also present in the body of bishops when, together with Peter’s successor, they exercise the supreme Magisterium,” above all in an Ecumenical Council.418 When the Church through its supreme Magisterium proposes a doctrine "for belief as being divinely revealed,"419 and as the teaching of Christ, the definitions "must be adhered to with the obedience of faith."420 This infallibility extends as far as the deposit of divine Revelation itself.421