Node.js How to Read Special Characters?

时间:2015-07-28 16:13:06

标签: mysql node.js steam-web-api

I have a Problem, when i try to add a String with a ™ in it, into a MYSQL Server it gives me an Error beacuse for some reason it can't Handle the TM Symbol ;(

My Error:

undefined:1
�
^
SyntaxError: Unexpected token 
    at Object.parse (native)
    at Request._callback (/home/ubuntu/workspace/bot.js:117:65)
    at Request.self.callback   (/home/ubuntu/workspace/node_modules/request/request.js:198:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/home/ubuntu/workspace/node_modules/request/request.js:1057:14)
    at Request.emit (events.js:129:20)
    at IncomingMessage.<anonymous> (/home/ubuntu/workspace/node_modules/request/request.js:1003:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16

My Code:

postToSQL("INSERT INTO website_skins ( classid, market_hash_name, item_price ) VALUES ('" + curInv.classid + "', '" + curInv.market_hash_name + "', '" + item_price_variable +"')");

The "curInv.market_hash_name" can contain the TM Symbol, and i want to still be able to add The TM Symbol into the MYSQL Server :)

How do i do?

0 个答案:

没有答案