开发者

php INSERT through Flash AS3 sometimes inserts weird Strings

I haven't got clue if this is a normal issue or not but I have a sma开发者_StackOverflow社区ll flash application that handles management for my company. It's a small company, so its not a big deal, its just a bunch of INSERTs, SELECTs, UPDATEs and other stuff to manage their clients, address, phone numbers, etc.

The flash (in AS3) sends the variables through a URLRequest to several php pages and the php handles the request to mySQL.

My problem is that, sometimes, instead of inserting the String I sent, it instead gets a weird string, made mostly, but not only, of numbers (and it happens like 1 column out of about 10 per INSERT, so its fairly common).

Is this a known issue? Could it be because of the encoding (I used UTF-8, which I believe is the one that we use here in portugal, due to special characters, like ã, à, á, etc)?

Thank you for your time.

Marco Fox.


After connecting to the DB, try the following query "SET CHARACTER SET utf8;".

Make sure every PHP page are in utf-8.
To do that, open the file in Notepad++ and use the menu Encoding -> Convert to UTF-8 without BOM, or open the file in notepad and ask to save as and look at encoding dropdown bellow name (this will save the BOM, which is not good).
Some IDE have the ability to save in ANSI, UTF-8 and more, or have the conversion option.

In Flash, use encodeURI() in your URLLoader data if you are passing it by GET.

Hopes that this solves your problem (if it is, in fact, encoding issues).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜