Jump to content

aur0ra

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aur0ra's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. For some reason the PHP XML parsing is splitting up the data within my elements if the data is unicode. I put the file paths within quotes hoping that would work, but no luck... My code is listed below, but first here is what the output looks like: [code] <FileData> ** ** <File> ** "/home/user/sandbox/ ** ** 田比首走雨.txt" ** ** ** <File> ** "/home/user/sandbox/English.txt" ** ** ** [/code] XML File: [code] <?xml version="1.0" encoding="UTF-8"?> <FileData>     <File>"/home/user/sandbox/田比首走雨.txt"</File>     <File>"/home/user/sandbox/English.txt"</File> </FileData> [/code] PHP code: [code] <?php // Parse the XML document containing the data for all of the file extensions. $xml_parser = xml_parser_create(); xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "charData"); if (!($fp = fopen("/home/admin/sandbox/test.xml", "r"))) { die("Could not open XML input"); } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d",     xml_error_string(xml_get_error_code($xml_parser)),     xml_get_current_line_number($xml_parser))); } } xml_parser_free($xml_parser); fclose($fp); function startElement ($parser, $name, $attrs) { echo "&lt;$name&gt;<br />"; foreach($attrs as $k => $v) { echo "&nbsp;&nbsp;&nbsp;&nbsp;$k - $v<br />"; } } function endElement ($parser, $name) { } function charData ($parser, $data) { echo "** $data **<br />"; } ?> [/code] If anyone has seen this before or has any suggestions I'd be very happy to hear them. This has been driving me nuts. I'd like to get my unicode paths in one shot just like I can with the english ones.
  2. I know segfaults are the most ambigious to deal with and I apologize for that... However this has been killing me... I'm running Ubuntu 6,06 and have installed apache2, php5 (and all supporting packages) via apt-get. I downloaded ming-0.3.0 as well as ming-php_ext-0.3.0 from sf, compiled both and installed them in to the appropriate directories (/usr/lib, /usr/include). I also installed the php_ming.so object and added the extension=php_ming.so at the end of my php.ini file. Any time my PHP page tries to execute any Ming functions apache reports the following error (which I'm assuming is from PHP): [Wed Oct 11 08:55:41 2006] [notice] child pid 5118 exit signal Segmentation fault (11) I created a simple C app that accesses a few of the libming functions and that works without any problems. So this leads me to believe that the problem really is within php_ming.so yet I cannot figure out how to debug it. Has anyone see this before or are there any suggestions on how to resolve this? Thanks for any/all help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.