I have a function that takes bytes32 _name
as a parameter and store it in a struct.
Let's say _name
is either Chinese, Korean, or Japanese and from app.js
I would convert the _name
to hex to pass it to the function.
App.contracts.Test.deployed().then(function(instance) {
return instance.storeName(web3.toHex(name), { from: account });
Now, when I retrieve the name
by calling the function and convert it using web3.toAscii
App.contracts.Test.deployed().then(function(instance) {
return instance.getStruct.call();
}).then(function(result) {
var name = web3.toAscii(result[1]);
the value would look like ÁÁ8È
. Is it something that web3.toAscii
cannot handle other languages or should I just use string _name
?