parka Posted January 26, 2009 Share Posted January 26, 2009 It seems like my sessions are not encoding my string properly. I can't seem to remember needing to set the encoding or charset or whatever. Here's my code. $sString = 'television’s'; $_SESSION['badstring'] = $sString; echo $_SESSION['badstring']; // Prints televisionÕs Note the typographer's quote mark after the word 'television'. It prints televisionÕs instead of television’s Any ideas how to solve this? Quote Link to comment https://forums.phpfreaks.com/topic/142481-solved-session-is-not-encoding-my-string-properly/ Share on other sites More sharing options...
gevans Posted January 26, 2009 Share Posted January 26, 2009 I just ran that on my local server and it has printed out properly, has this just happened recently, and if so do you know of any changes that have been made to the server recently? Quote Link to comment https://forums.phpfreaks.com/topic/142481-solved-session-is-not-encoding-my-string-properly/#findComment-746595 Share on other sites More sharing options...
premiso Posted January 26, 2009 Share Posted January 26, 2009 I do not know if the pages Content-Language is set to something else maybe that affects it? Check your phpinfo and if anything weird is going on with the language. Or maybe it is giving out garbled junk with sessions cause the session files are being trashed? But yea, check your configurations etc. Quote Link to comment https://forums.phpfreaks.com/topic/142481-solved-session-is-not-encoding-my-string-properly/#findComment-746601 Share on other sites More sharing options...
parka Posted January 26, 2009 Author Share Posted January 26, 2009 Thanks all I think it's the encoding for my .php file. When saved as a UTF-8 encoding, the echo() command works ok. Quote Link to comment https://forums.phpfreaks.com/topic/142481-solved-session-is-not-encoding-my-string-properly/#findComment-746677 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.