Downlink Data issue

Hello,
we are doing the chirpstack integration with cpp. we are facing on issue in downlink api.
i am passing the base64 encoded data to the set data dunction to the api.
i am passing the same data “JgMCAAAAAAAAAABwLlk=” from UI and chirpstack rest api. it is showing correctly. but when i am passing through the
request.mutable_device_queue_item()->set_data(“JgMCAAAAAAAAAABwLlk=”); this. i am geeting different data on UI. Please suggest what to pass in request.mutable_device_queue_item()->set_data(“JgMCAAAAAAAAAABwLlk=”) api.

Note: when i am passing the char array it is treating 0 as a null and i am getting only “JgMC” data on UI.