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 796821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:41:58+00:00 2026-05-14T22:41:58+00:00

I have a MySQL database of newspaper articles. There’s a volume table, an issue

  • 0

I have a MySQL database of newspaper articles. There’s a volume table, an issue table, and an article table. I have a PHP file that generates a property list that is then pulled in and read by an iPhone app. The plist holds each article as a dictionary inside each issue, and each issue as a dictionary inside each volume. The plist doesn’t actually hold the whole article — just a title and URL.

Some article titles contain special characters, like curly apostrophes. Looking at the generated XML plist, whenever it hits a special character, it unpredictably gobbles up a whole bunch of text, leaving the XML mangled and unreadable.

(…in Chrome, anyway, and I’m guessing on the iPhone. Firefox actually handles it pretty well, showing a white ? in a black diamond in place of any special characters and not gobbling anything.)

Example well-formed plist snippet:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
    <key>Rows</key> 
    <array>     
        <dict> 
            <key>Title</key> 
            <string>Vol. 133 (2003-2004)</string> 
            <key>Children</key> 
            <array>         
                <dict> 
                    <key>Title</key> 
                    <string>No. 18 (Apr 2, 2004)</string> 
                    <key>Children</key> 
                    <array>                 
                        <dict> 
                            <key>Title</key> 
                            <string>Basketball concludes historic season</string> 
                            <key>URL</key> 
                            <string>http://orient.bowdoin.edu/orient/article_iphone.php?date=2004-04-02&amp;section=1&amp;id=1</string> 
                        </dict>

                        <!-- ... -->

                    </array>
                </dict>     
            </array>
        </dict>
    </array>
</dict>
</plist>

Example of what happens when it hits a curly apostrophe: This is from Chrome. This time it ate 5,998 characters, by MS Word’s count, skipping down to midway through the opening the title of a pizza story; if I reload it’ll behave differently, eating some other amount. The proper title is: Singer-songwriter Farrell ’05 finds success beyond the bubble

                    <dict> 
                        <key>Title</key> 
                        <string>Singer-songwriter Farrell ing>Students embrace free pizza, College objects to solicitation</string> 
                        <key>URL</key> 
                        <string>http://orient.bowdoin.edu/orient/article_iphone.php?date=2009-09-18&amp;section=1&amp;id=9</string> 
                    </dict> 

In MySQL that title is stored as (in binary):

53 69 6E 67 |65 72 2D 73 |6F 6E 67 77 |72 69 74 65
72 20 46 61 |72 72 65 6C |6C 20 C2 92 |30 35 20 66
69 6E 64 73 |20 73 75 63 |63 65 73 73 |20 62 65 79
6F 6E 64 20 |74 68 65 20 |62 75 62 62 |6C

Any ideas how I can encode/decode things properly? If not, any idea how I can get around the problem some other way?

I don’t have a clue what I’m talking about, haha; let me know if there’s any way I can help you help me. 🙂 And many thanks!

  • 1 1 Answer
  • 1 View
  • 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-14T22:41:59+00:00Added an answer on May 14, 2026 at 10:41 pm

    here’s a few options

    • use htmlentities() to encode special characters when inserting in the table
    • change everything to UTF-8
    • try using CDATA around the titles ie

      <string><![CDATA[ BLAH BLAH BLAH ]]></string>

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

Sidebar

Related Questions

I have a MySQL database table that contains an Article ID ( primary key
I have a mysql database, in there I have 1 table. That table contains
I have this MySQl database that has a table which contains a column that
I have a mysql database that is currently running very slow. There are a
I have a mysql database that has 2 table. the first table contains the
I have a mysql database table that contains multiple user photos. I am trying
I have a MySQL database table with two columns that interest me. Individually they
I have mysql database with table users. In users there are columns: id ,
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I have a MySQL database table with a couple thousand rows. The table is

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.