If you want to convert strings in solidity to byte32 and you get different kind of error messages at explicit or implicit converting or at changing between memory and storage variables, you can use the following function:
function stringToBytes32(string memory source)
returns (bytes32 result) {
bytes memory tempEmptyStringTest = bytes(source);
if (tempEmptyStringTest.length == 0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}