Currently I'm using ether.camp to create a contract. At this stage it simply gets and stores some values. However when I try and get the values they are in bytes/hex even though the return type is string?
How do I convert this back to string in the solidity contract? I've tried How to convert a bytes32 to string but no luck
E.g storing "Hello World!" returns 0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000c48656c6c6f20576f726c64210000000000000000000000000000000000000000
contract HelloWorld {
struct Items {
address id;
string data;
}
mapping(address => Items) items;
function getItem(address key) returns (string) {
return items[key].data;
}
function addItem (address key, string data) returns (bool) {
Items item = items[key];
item.data = data;
}
}
}
I can see in the ethercamp transactions side bar of the IDE the "Hello World!" is saved as a string but my getItem()
just can't retrieve it?