GNOME Bugzilla – Bug 734629
ChamplainFileCache appends garbage characters at the end of cached String.
Last modified: 2014-08-11 21:07:10 UTC
I am caching POIs as a JSON String using ChamplainFileCache and in some cases it adds random characters at the end of the string. I am caching the string after converting it to Unicode. I am directly caching the data with no Information Header of any sort. Do I need to add a header or ChamplainFileCache does it by itself?? For example, """ Data/Type : json Data/Size : 1455... [JSON DATA] """ Is ChamplainFileCache was made to cache images only and I need to implement my own caching for JSON strings??? Because in case of images (map tiles) a few garbage characters wont affect the image much.
Although ChamplainFileCache is able the JSON string (maybe not properly) but ,this line of code assumes the data to be cached as an image (".png"). https://github.com/GNOME/libchamplain/blob/master/champlain/champlain-file- cache.c#L475
The .png extension is no problem here (just the name of the file). The problem (probably ) is the result is ChamplainTile so you are probably seeing some binary data from that. The cache definitely isn't meant for this use and implementing your own cache is the right way to go.