0

I have a SQL Server database extract I'm doing.

At the beginning of my program, I have:

ini_set('mssql.charset','cp1250');

My database calls do not do anything special.

I'm only call the following methods:

mssql_connect, mssql_select_db, mssql_query, mssql_fetch_object, 
mssql_next_result and mssql_close.

When I print the output of my export on screen, all the characters look fine. When I export fputcsv() into a csv file, I get a ton of <92> and <93> characters (this is the way that they look when I use a terminal to read them). When I open the file using Excel, they look like ì, í and î

This is causing major problems. Do you have any ideas?

2 Answers 2

1

try to convert encoding into utf8

iconv('cp1250', 'utf-8', $text);

also print this:

var_dump(iconv_get_encoding('all'));
Sign up to request clarification or add additional context in comments.

1 Comment

output of var_dump: array(3) { ["input_encoding"]=> string(10) "ISO-8859-1" ["output_encoding"]=> string(10) "ISO-8859-1" ["internal_encoding"]=> string(10) "ISO-8859-1" } Output of iconv: Äô characters everywhere in the csv.
0

Thanks but it turns out that the problem isn't with the encoding so much as it is with the fact that my fputcsv() call actually was not specifying a delimiter. I chose "\t" for the delim and everything worked perfectly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.