Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6147523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:07:07+00:00 2026-05-23T19:07:07+00:00

right I’m running a mssql stored procedure in PHP and the accented characters appear

  • 0

right I’m running a mssql stored procedure in PHP and the accented characters appear to be returned as ?
The stored procedure is

ALTER PROCEDURE [dbo].[dbname]
@ProjectID AS int
AS
SELECT ProjectName COLLATE SQL_Latin1_General_CP1_CI_AS AS ProjectName, 
CustomerName COLLATE SQL_Latin1_General_CP1_CI_AS AS CustomerName
FROM Project
WHERE ProjectID = @ProjectID
END

My PHP relating to this is (the return values shown are for ABCDĒčďāĀÖØÖÖÃēù)

$dbhandle = mssql_connect($myServer, $myUser, $myPass)
    or die("Couldn't connect to SQL Server on $myServer");
$selected = mssql_select_db($myDB, $dbhandle)
    or die("Couldn't open database $myDB");
$stmt=mssql_init("select.Project", $dbhandle);
$desktopid = $_GET['desktopid'];
$compid = 0;
$custid = 0;
mssql_bind($stmt, "@ProjectID", $desktopid, SQLINT4, FALSE, FALSE);
$result = mssql_execute($stmt);
$row = mssql_fetch_assoc($result);
echo $row['ProjectName'];          ==== ABCD????????????
utf8_decode($row['ProjectName']);  ==== ABCD????????????
utf8_encode($row['ProjectName']);  ==== ABCD????????????

I could do with a hand figuring out how to decode the characters that the function returns I’ve found no help from other sources online and I’ve even tried several fixes from stack overflow to no avail.

Please also note that if I had the choice I would be using mysql with php not mssql and that I have php running on a debian server

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:07:07+00:00Added an answer on May 23, 2026 at 7:07 pm

    I needed to call ini_set('mssql.charset', 'UTF-8'); (or change that setting in the php.ini file).

    Thank you to Mikael Eriksson for giving me the search term I was missing (unicode) to help me find the answer on http://agimpert.blogspot.com/2011/01/unicode-php-headaches.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I'm doing something like this: RewriteRule ^/?logout(/)?$ logout.php RewriteRule ^/?config(/)?$ config.php I
this is what i have right now Drawing an RSS feed into the php,
Right now I have a username being stored in NSUserDefaults and the password in
Right now I have a considerable amount of would-be magic numbers stored in constants.
Right now I'm stuck between using PHP's native session management, or creating my own
Right now for my application when I want to alter data for my ContentProvider,
Right now, I keep all of my projects on my laptop. I'm thinking that
Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?),
Right, initially ran: c:\regsvr32 Amazing.dll then, (accidentally - I might add) I must have
Right up front: I do not want to start a religious war. I've used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.