Radio frequency (RF) signal based simultaneous wireless information and power transfer (SWIPT) has emerged as a promising technique for satisfying both the communication and charging requests of the massively deployed IoT devices. Different from the physical layer and the medium-access-control layer design for coordinating the SWIPT in the RF band, we study its coding-level control from the information theoretical perspective. Due to its practical implementation of the decoder and its flexibility on the codeword structure, the unary code is chosen as a potential joint information and energy encoder. By conceiving the classic Z-channel, the mutual information and the energy harvesting performance of the unary coding aided SWIPT transceiver is analysed. Furthermore, the optimal codeword distribution is obtained for maximising the mutual information, while satisfying the minimum energy harvesting requirement. Our theoretical analysis and the optimal coding design are demonstrated by the numerical results.