Debugging Charset
We've been building a pretty big web app here for internal use. SMS text messages come in from an aggregator and are stored in a MySQL 4 db. Our operators then deal with them using a web interface. The db is queried using PHP4 and the results output as XML which is then transformed using XSLT into XHTML.
Now, in our testing environment everything works just fine. However, when we try and run it with actual live data, any incoming SMS message that contains a non-ASCII character breaks the system at the Sablotron stage (invalid token). Now the aggregating service is sending us the incoming messages UTF-8 encoded. The XML and XSL is all set up to be UTF-8.
However, somewhere along the lines something is getting screwed up so that Sablotron barfs (typical examples are pound signs or euro signs). I'm having a hard time debugging this because as far as I can tell everything is set to be using UTF-8 by default. Clearly something isn't (MySQL possibly). I'd really appreciate some pointers for things to check.
View Complete Forum Thread with Replies
Related Forum Messages:
Charset | 2 Charset Codes In 1 Page
I don't know if it is possible without for example iframe but I would like to avoid iframe command : _ I want to output a page divided in two parts <table style="width: 100%"> <tr> <td> ... TEXT in UTF-8 charset... </td> <td> ... TEXT in windows-1251 charset... </td> </tr> </table> Sharing two charset codes in the same page. Any idea how can I do it?
View Replies !
Charset
I'm a newbee, also in english. The thing is that I have a kind of javascript based search engine that use a .txt as its database, it has several field delimited by tabs. What I want to do is using the same application to diferents projects. I just change the look, the datas and I have another beautiful serach engine. How I don't know much about javascript, I made a PHP script that builds a .txt with identical structure to the one I have just explained and fill it with the datas. But It doesn't work. I have noticed that the javascript says anywhere something about "unicode" charset. The PHP script make a entirely new file each time from a Access database, I do this because I needed to modify some database content in some fields, and I think that It doesn't use the same charset that javascript. I belive this because I tested to paste same records directly from txt formed by PHP script to original txt and when saving WordPad tell me something about that I'm saving without format and I am going to loose any format issue. And after this, I could see throught the serach engine the records pasted in the txt. I am using WinXP, Nusphere, Dreamweaver, etc, everything in spanish (so the charset, I think It is ISO LATIN number-015, with Euro, I'm just guessing)
View Replies !
Mssql And Charset
I use the MSSQL function for connecting to a MSSQL database but i have a problem with the charset. My database is in SQL_Latin1_General_CP1_CI_AS and the result of the query with special char are false (ex : é ->S or à->Ø) How can i define the charset of each query?
View Replies !
CHARSET (PHP & MySQL)
I saw that there was some writing about it but nothing helps I have hosting in some firm in US. I set ma database charset to windows-1250. I also set all tables to that charset. Insert with phpmyadmin works fine but when I use php, as output I get strance chars. When I use php to enter data insted of special chars I get "?" or none. Its strange for me becuase when I use SQL trough phpmyadmin and execute script that insert rows all data are inserdet right! Do I need and can it be done to setup charset for PHP. I dont have admin privilegies on server :)
View Replies !
Problem With Charset
i've some problem to print to screen and save date in mysql if the entries contain char like à,è... i try to read some post but i'm not able to solve my problem. i use easyphp 1.8 with apache 1.3.33-php 4.3.10-mysql 4.1.9 SO:windows vista home premium in php.ini i've: default_charset = "utf-8" in phpmyadmin i can read: language: italian (it-utf-8) char set: utf-8 unicode (utf8) collation: utf8_unicode_ci int hte browser meta tag: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> the table structure is: id int(11) question varchar(255) utf8_general_ci answer text utf8_general_ci so if i make select * form table where 1, the output on screen is: 1. abad?? Modify (hope that you see 2 squares after abad it would be abadà) 2. academia Modify 3. agog?? Modify (hope that you see 2 squares after agog it would be agogò) clicking on modify appear a form with a text box and a text area and the strange is that in the form i see the right char. in mysql the data of the table are abadà academia Agogò
View Replies !
Eclipse, Charset And PHP
I'm trying to internationalize my PHP code, but some of the ISO-8859-2 characters don't show in the browser. I'm namely trying to use Croatian and Russian, and some of the characters show and most don't. I did the header (that's the one for Croatian) header("Content-Type: text/html; charset=iso-8859-2"); but it doesn't work. When I type my strings in Eclipse it is all fine and I see all the characters that I want. Is it maybe an Eclipse setting I need to worry about? What am I missing? It is not the browser, as I can see all the Croatian/Russian pages just fine. Server maybe?
View Replies !
Charset And MS SQL Server
I use php on a windows XPpro and a MS SQL Server 2000 The result of the query are different of the content of the table example : in database : protégé in the HTML doc after the mssql_query : prot,g, the database is in "SQL_Latin1_General_CP1_CI_AS" COLLATION_SEQ and i don't know the charset equiv If anyone know the response for me or another solution?
View Replies !
Excel And Php Dom Charset
i use a simple script for decoding excel exported xml. But i have problems with my encoding (windows-1251). Here is the code i think i got it from ibm dev network and its pretty simple just trying to get it working: Code:
View Replies !
Charset Problem
I am having charset problem at the moment, if i try: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> some of the character which are in Tarkish language don't work and if i use: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> others don't work. I even tried: utf8_decode() utf8_encode()
View Replies !
Default Charset
When not specifying the charset in a php script, which one is used by default? A php server seems to have a default charset setting (see phpinfo below of my host's server). Code: php core default_charsetno value Apache Environment HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP Headers Information Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP Headers Information Content-Type text/html; charset=iso-8859-1 Though this one seems to have a default charset setting of none, does the http headers information mean that any website or php script accessed with the browser's address bar gets a iso 8859-1 by default anyway?
View Replies !
MYSQL Charset
i'm building a blog for my personal website with MYSQL , the language i used is Vietnamese , when i use PHP connect to MYSQL and mysql_fetch_array , it displat ? mark ! I think it's charset error . I've check PHPmyAdmin but PMA display the charset is OK ! Here is the picture. The first one is MYSQL Record Table , the second is PHP Display . Some charater like #xxxxxx displays ok ( HTML Special Char , not a function ) , some words like co' -> PHP Display ? .
View Replies !
Charset Conversion
I am trying to read and display data from a mysql database. The data stored in the database is i think UTF-16. It is all hexadecimal numbers. I need to convert these numbers to normal fonts that we can read and convert the normal fonts to UTF-16 which are hexadecimal numbers.
View Replies !
Change Charset?
After installing WAMP 1.6.1 I have problems viewing pages (phptogalleries) that necessarilly use folder and file names written with CE special characters supported onlz bz charset windows-1250. How can I change slovak-utf-8 to windows-1250?
View Replies !
PhpMyAdmin - Problem With Charset
I have problem with charset in my Mysql database. server 1(localhost): Mysql version 5 with php5 MySQL charset is UTF-8 Unicode (utf8) MySQL connection collation - latin2_general_ci server 2: Mysql version 4.1.8 php 4.3.10 MySQL charset is UTF-8 Unicode (utf8) MySQL connection collation - latin2_general_ci As you can see both servers have same charset configuration, so here can't be any problems. When i'm trying to dump data from one of the table from my db ( server 2 -> server1) in result mysql gives me strange symbol. For example "£(from polish alphabet) replaced by?". I'm from Poland so i'm trying to use ISO-8859-2 charset style. In my PhpMyAdmin configuration file i have: /* From config.default.php */ $cfg['DefaultCharset'] = 'iso-8859-2' My apache 2.0 get on well with words like £,¹,¿,Ÿ... If you can give me some advice(s) please reply for this post.
View Replies !
Unknow Charset In Database
This problem of charset support seems to annoy many people, and I haven't found a solution so far. Our php.ini as well as page content type charset are iso-8859-15 (for support of Euro sign). In a form, users sometimes paste text written first in MS Word (even if I was not aware of this at first). Each input is html_entitized before INSERT in the MySQL database. It seems however that some browsers overwrite the charset encoding of the page, so that I'm not sure what the charset encoding of the input really is. But since I was not aware of the problem, I haven't checked the input on that. Anyhow, input validated error checking, and was written in database. Here again, I have no idea with which encoding. At least, I've seen that the charset Index of our MySQL version has no cp1252 nor utf-8, even if I'm not sure if that's an issue or not. Also, when looking at the content in MySQL, some of the "odd" MS Word characters are no entities, but just glyphs. Anyhow, when retrieved from database and echoed in a webpage, these are replaced by a "?", meaning at least that they are outside the iso-8859-15 repertoire. Trying to be smart, I did a utf8_decode($string); on a sample, but still got the "?" instead of curly quotes, em dashes, ellipsies etc. utf8_encode made it even worse! Even a mb_convert_encoding($string, "iso-8859-15"); on the same sample did not cure the problem, and also returned "?" as substitute character. As for pasting the "odd" sample in an input field and check that, this will not teach me much, since my configuration has nothing in common with the ones of our users around the world. I even know of someone dealing with Russia having an old French version of MS Office, enabling Cyrillic encoding, all of which is running on a Mac! God only knows what charset that might send through the browser when pasting text in a textarea. I also tested on just a sample, because the "oddity" can be nested into a very big text, and not always near the beginning of it. The problem has two sides: - first, I should find a way to echo correctly what's already stored in database; - second, I should find an efficient way to identify and convert 100% of the "odd" characters, so as to keep ALL of the input inside the iso-8859-15 repertoire before sending it to the database, to avoid further pollution. Even the very extensive explanations of ergophobe and some of his code samples did not help to solve this.
View Replies !
Scpecial Chars - 'Ãi' To 'á' - Charset
I have a sql table that contains files saved with special chars i think, for example, 'AmapÃi', where we expect 'Amapá'. When i debug my var on phped, i see 'Amapá' and when i look at any browser, netscape or IE i see 'AmapÃi'.
View Replies !
PHP Standalone: Charset Setting
I'm simply using PHP as a programming language, and I just want to print some text information to stdout, but instruction print "é" (é) does not print my "e" with an accent in the shell window: wrong charset. How to set the correct charset?
View Replies !
Convert STRING Charset
I have a MySQL database, which stores data in UTF-8 Unicode format. I have a webpage which has a form where I enter data to store the information and the CHARSET for that page is ISO-8859-1 (latin1). When I fetch data from my database on a page that has the CHARSET ISO-8859-1 the output is great! But when I now from another page has UTF-8 Unicode CHARSET set and fetch data from the database, some of the characters are messed up (like the Swedish Å Ä Ö characters). My question follows: Can I with PHP, fetch text from my database into a STRING and then "convert" from ISO-8859-1 to UTF-8 Unicode before outputting it to the page which has CHARSET UTF-8 Unicode? OR Do I have to "loop" through and replace "bad/wrong" characters into UTF-8 Unicode, and if so, HOW?
View Replies !
Charset And Special Symbols
So my language includes symbols like č,š,ž etc. Now I'm not so sure how to input them, I set charset to UTF-8, collation in db is utf8_unicode_ci but symbols get converted to some strange ones in db. So I was wondering that I convert them into ascii (č, š,ž) so that I can process them. How should I do this? if I use html_entity_decode(), then I need to change charset to iso-8859-1, which isn't big problem, but the thing is that all symbols are not converted, symbols like š, ž etc... I checked around and I looked into cms drupal and now I'm wondering how did they managed to use utf-8 charset, but still inputs stay unchanged, so if we insert č,š,ž it shows č,š,ž in database and this would be perfect for me.
View Replies !
Mssql Charset Conversion
It looks like I am having a problem reading in the ' and " from a MS SQL database. I am assuming this is because they really are "smart/curly quotes" I have everything that I can think of set to use utf-8 but I am still getting errors thrown in my face. I am new to this PHP thing and have not had any problems with mysql db's before, but I have to get my app to work with MS SQL until they get around to porting it over to mysql.
View Replies !
Charset - Display All The Values
I have developed my site in the charset iso-8859-1 . later my client asked me to change the charset to UTF-8 .. in My databse the previous values are stored in the format "iso-8859-1" now newly stored values are UTf-8 format. In the common page (UTF-8) i have shaw the all the values at that time it have faced the problem newly stored values return the correct format but previous values are not shown in the correct format. I have used the htmlentities() function to display the previous values in correct order but the new values are changed by using the function. I need to display all the values in proper.Please any one give the Best solution for the questionnaire.
View Replies !
Email Charset Problem
The problem i came across is that i can't quite send an email with greek text on it. In gmail or in outlook, the email appears correclty. But in hotmail and yahoo, the email appears in funny characters, which of course can be fixed by changing the encoding of the page. Also, after change the page encoding, i can read the subject of the email correclty, except in outlook inbox where it is scrambled always - no matter what. The email content and subjest appears correctly in outlook email preview screen. Code:
View Replies !
MySQL Charset Issue
I am doing a project and some of the database information is being displayed in the borwser as a tilted box with a question mark inside. Does anyone know what I should set my charset to be to avoid this? The website will be for us residents.
View Replies !
Charset Translation Table
I'm trying to convert some charactors with htmlentities(), but by checking PHP Code: print_r(get_html_translation_table(HTML_ENTITIES)); find it's very limited charset. Is there any way that I can add more to this convert table?
View Replies !
Standard Html Charset?
I'm not quite a HTML newbie but this is a newbie sort of question. Just something I haven't bothered checking out until now. What is the standard HTML charset (you know like iso-8859-1 etc.)? The website is for an English speaking market so US, UK mostly.
View Replies !
Debugging PHP
My boss and I are fairly new to PHP and would love to hear suggestions on how to debug PHP with ease and efficiency. Thank you for your time and consideration.
View Replies !
PHP Debugging
I have been programming in php for few years but have never used anything but free hosting to run php. My programming requirements have evolved and now I am in need of a debugger to understand how code is functioning (so I want to be able to step through the lines of code, watch variable values and object contents etc.)Code:
View Replies !
Debugging In Php
What is the best way to debug in php? What is the best way to see the value of your variables? I'm coming from the Flash MX world, and in there, you can do a trace() and it traces out the value of your variables to the message window. PHP has print and echo but that seems to mess up the page layouts too much. Is there a way to print variables to a log file?
View Replies !
Debugging PHP In OS X
if there are any other mac users out there who have managed to get a debugger up and running in OS X. Im not finding any decent tutorials that let you use a stand alone debugger (i.e. not integrated with zend studio or komodo). I generally use textmate for editing and would like to find something i can use along with that.
View Replies !
Debugging
how to set the error handling in the ini file to E_ALL, E_ERROR, E_WARNING etc. We had everything setup and working then we had to restart the server and it for some reason, reset the ini file back to the way it was. SO we went back to the ini file and set it back up but now it does not work. We even set it to just E_ALL. And nothing. We just get a white page. Code:
View Replies !
Charset - Grabbing Data From The Database
Im grabbing data from the database, which has the utf8_general_ci mysql collation. the problem is that special spanish characters like: "párrafo" print themselves like "p?rrafo" Why? How could i fix this? Im already using this header: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> When i check the data in myPhpMyAdmin it has de "párrafo" value... but when i print it i only get p?rrfo. BTW, im running my apache on Windows and already installed the iconv extension.
View Replies !
Problem With Php, Json, Browser, Charset
I am having a problem that is occuring when using php, json, utf-8 charset and IE7. It sounds like a browser (thus client side) problem but since it is occuring on a php driven website, I think the best help I can get is here. Given: webpage (valid XHTML, utf-8 charset) with form (I use the YUI dialog), using javascript I collect all the user input on the form,...
View Replies !
Special Characters - Charset Problem
When opening a html file with include() my page does not show special characters, instead it shows something like "?" I've already saw a document about this and I got to the conclusion that is some charset problem... but when reviewing my html code I noticed the following line: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> So I guess it's not this charset problem... or is it? What's wrong?
View Replies !
Default Charset And Collation Sequence
I have been trying to figure out what charsets and collation sequences I need. For some reason phpmyadmin (running on my local machine) insists on giving me defaults of latin1_swedish and I can't seem to tell it how to give me something else as default. The problem with the swedish is that a query involving LIKE eg select * from dogbreeds where breedname like '%beagl% seems to fail with latin1_swedish . But if I change all the columns to UTF_8 it works OK. So, my question a) is there any reason why I should not use UTF-8 as the default? b) any clues as to how I can make phpMyAdmin or mysqlAdministrator see that as the default for each table and the database?
View Replies !
Force String Into ISO-8859-1 Charset
I'm developing some code that used a SOAP call to insert records into a remote database. However, the SOAP call is reliant on the string fields in the inserted record being of character-set ISO-8859-1. If it encounters another type of character, the SOAP call throws an 'illegal token' error. The problem is that the these strings can sometimes be of various other charsets (they are received, mime-decoded email bodies). Code:
View Replies !
Chinese Characters (charset Big5).
I have a web page contain Chinese characters (charset big5). If I name the page as mypage.html.big5 or mypage.big5.html then the browser can identify the charset automatically. However, if I add "<?php echo <<<END ...mydoc here ... END; ?>" and name my page as mypage.php.big5 or mypage.big5.php ... well it doesn't work. How can I make php or Apache to understand file extension .php.big5 or big5.php.
View Replies !
Help Debugging Query
I was wondering if anyone can help me here? The following code sends out an email alert to members of my site when a matching result is found....
View Replies !
Debugging Query
I can't for the life of me work out why I keep getting this error: ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username='billybob')' at line 76 PHP Code:
View Replies !
Installation Debugging
1)I get startup error messages: "Unable to load dynamic library c:phpphp_curl.dll - the specified file cannot be found" although the file is very much there at exactly that location Not only for this file but for many extension files like php_mysql.dll, php_oracle.dll, php_mssql.dll, php_exif.dll etc. 2)the extensions_dir setting is "c:php" without an ending backslash. 3)The php.ini file is residing at c:php 4)The php.ini file in c:windows has all extensions disabled so it does not look as though that php.ini file is the source of the messages 5)There is a extension entry for php_win32api.dll which also gives a not found error. Is it the older version of php_win32std.dll, php_win32service.dll and php_win32scheduler.dll files which are present but their names are not there by default in the php.ini ? ************************************************** ************************************************ 6)How do I debug PHP like you can debug Java in Eclipse or NetBeans and C/C++ in MS Visual Studio - with breakpoints and stepping? ************************************************** ************************************************ 7)database access through odbc works. 8)How do I install PHP as both a CGI extension under Apache 2.0.5x and as a module (php5apache2.dll with a LoadModule in httpd.conf) - Apd which is a part of PEAR requires that php be installed as a CGI binary - is apd good for interactive debugging?
View Replies !
Debugging In Komodo
Does anyone use Komodo from activestate to write their PHP? If so, have you used the debugger? I'm new to debugging with an actual debugger (I'm kinda old school and have always relied on echo and print...). When I'm running it, the debugger stops at EVERY SINGLE line of PHP code... I'm debugging a pretty long script and it just takes WAY too long. Is there a way to tell the debugger to just execute the code up to a certain point?
View Replies !
XOOPS Debugging
I am working with this XOOPS CMS and started having problems. Everything was working fine all pages, modules displayed, then it just went blank. Now I tried doing some trouble shooting following the advice on their site about what to do if I am ending up with blank pages. The thing is I cannot even get to the admin login page to set the debugging options from there. Anyway I changed the debugging options via the database and still no errors are being displayed.. just the blank page. I look at the error logs form the server and went through each module folder and looked to see if there was any error logs. 2 of the error logs state that that there was an unexpected $ in one the XOOPS common.php file and it pointed out the line number. I have looked there and see nothing and I know that the error does have to occoured there it's just where the script halted. My question is that the error could have orignated from any module.. How can I get some errors to show on screen so i ca do a trace. I here it could be possible via .htaccess.
View Replies !
Debugging PHP4 With Dbg, Gdb, And Ddd
I want to create a debugging environment for PHP. I running Debian Woody and installed PHP4 from Debian's packaging system. I downloaded precompiled DBG from the webside and placed dbg.so in the same directory as mysql.so, Since MySQL works under PHP, I'm assuming I've got the right directory. I've updated php.ini per the DBG website. phpinfo() reports: 1. --disable-debug was part of the ./configure command. 2. ZEND_DEBUG=disabled, but the report does indicate that dbg is part of the Zend engine setup. 3. In the section on dbg, it reports dbg version 2.11.23, linked as a shared library; profiler compiled,enabled; debugger.enabled=on; etc. If I want to debug with dbg and gdb, do I have any options other than to recompile PHP omitting the "--disable-debug" switch? Once I do (or don't do) that, how does one hook gdb into dbg? How do most PHP developers who don't own a commercial IDE debug their programs?
View Replies !
PHP Error Debugging
I have been working with PHP for a while, but never gone through getting a good debugger - or debugging methodology. Can someone send me links to suggestions and possibly good (free) software? I am not hosting the website, so I cannot tell it to report all errors directly from the installation. I tried error_reporting(E_ALL ^ E_NOTICE); on top of the page, but that does nothing. So it always takes a while for me to fix the errors.
View Replies !
Debugging My Functions
I wrote this code to validate a few fields on a form which will be submitted when a customer wants a refill of their prescription medication. The first problem is none of the functions actually work properly. Both of the functions that validate names should throw an error if a name has less than 2 characters inputted in the field. Yet, it doesn't throw any errors if I insert only one letter in the field. The next function should verify a phone number. I can put a phone number with 6 numbers in it and it won't throw an error even though it is to short based on my regular expressions requirements which says it needs 7 to 14. The last function doesn't throw an error if I put <a href="bob"> in the comment box and it should throw an error if it finds a <a> tag. Code:
View Replies !
Debugging Error
I'm getting this error message after submitting a form in PHP: Fatal error: Call to undefined function sql_errno() in /home/jplane/ certcent/phpweb/phpnuke/html/admin/modules/quiz.php on line 542 It's suppose to write information to some sql tables. I'd like to further debug this message, maybe in mysql?
View Replies !
Installation, Debugging
(I am posting from a web interface- google groups, yet the message is not appearing on the group, so am posting again, if you get two of the same kindly ignore one) 1)I get startup error messages: "cannot load c:phpphp_curl.dll - the specified file cannot be found" although the file is very much there at exactly that location Not only for this file but for many extension files like php_mysql.dll, php_oracle.dll, php_mssql.dll, php_exif.dll etc. Code:
View Replies !
Debugging Advice
syntax highlighting what methods or programs do people on here use to debug their php? I'm using linux so foss programs that run on both win and linux.
View Replies !
Debugging Rapidly
is there any program which shows all variable assignments during the running of a php script. im getting sick and tired of using echo $myvar to debug.
View Replies !
|