Solved

How can I deal with special characters in query results from mssql using php

Posted on 2013-12-05
4
368 Views
Last Modified: 2016-03-02
Hi!

I have a query that returns product description, and I have run into a problem dealing with the returned values.    This data is coming from MSSQL and I am using php to query the data.

Two specific things I have run into is data that includes a product name with a copyright signal next to it.  And the other is quotations and apostrophes that are tilted in/out instead of just the keyboard standard.  Does that make sense?

I am sure there are others . . ..

Is there anyway I can utilize these special characters?  The data is going into mysql Magento database.    If not, is there a way to get around the ? signs that are displayed instead?

Thanks!
0
Comment
Question by:lthames
  • 2
4 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
You are probably getting those characters from data that came from Microsoft Word or maybe Excel in the Windows -1252 character set.  That is very similar to Latin1 ISO-8859-1.  What character set is your web page using?
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
Is there anyway I can utilize these special characters?
Yes, of course.  You can convert them to the UTF-8 equivalents.  This article tells how.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11880-Unicode-PHP-and-Character-Collisions.html
0
 

Author Closing Comment

by:lthames
Comment Utility
WOW . .  . . very informational.

I learned alot reading your article.

OH. . . and the adjustments I made based on the article worked!
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
Great!  Thanks for the points and thanks for using EE, ~Ray
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now