Convert UTF-8 fields
Well I have a problem that is easily solved by a method not at all optimized but if someone has a simpler and less greedy then i will be glad.
I am in utf8 or iso I have? in squares for all E E O and other special characters.
Problem: If I will try to develop my code to put utf8_encode to all my fields, It will take 8 months.
I tried to put a return utf8_encode (mssql_fetch_array ($ rs)) (among others) but it's an array so it does not help much.
Method that I would do easily, but given the number of loops that I am already paying in all directions and the number of records that I have in my table, I am afraid that doing that gives me time to answer yet longer than they are currently (and yet, God knows that I opt as I can).
Re: Convert UTF-8 fields
You need to have encoder / decoder that if you voluntarily chose to keep working on elements of different encodings.
That was my case for example when I wanted to make connections to a SQL Server configured to ANSI with one of my projects for all of UTF8.
Mysql, you need to easily define the encoding of communication with PHP.
With SQL server, I have not found any method to do so for me it is dependent on the configuration of the server.
You can choose any stalling on SQL server or to retain a different element in knowing when they should be converted into input and output.
Once you have selected your encoding, you must make sure
- Your PHP files are all written in this encoding.
- Your HTML code indicates that encode head
- Communication to mysql is not in this encoding (see SET NAMES) and merging the tables is the correct type.
Re: Convert UTF-8 fields
Make sure that utf8_encoder convert UTF8 to iso but if your string is already UTF8, it will be not be convertible.
You can not use it as if you don't know what encoding you are currently using for other characters .
Personally I have tried to detect the encoding of a string just to see if I have been able to convert or not and it was very unreliable.
|Tags: array, encode, mssql, utf8|
|Thread Tools||Search this Thread|
|Similar Threads for: "Convert UTF-8 fields"|
|Thread||Thread Starter||Forum||Replies||Last Post|
|What are the required fields in Excel?||Chini mao||Windows Software||2||06-01-2012 08:59 PM|
|How to Use Password Fields in Java?||pushpendra||Software Development||5||10-02-2010 05:46 AM|
|Why to use set/get methods for private fields?||Klaty||Software Development||5||05-01-2010 12:08 PM|
|Show all fields except id||Xmen||Software Development||3||08-12-2009 01:56 PM|
|How to add two fields in ms access?||lootera||Windows Software||3||03-09-2009 09:18 PM|