Can't store strings with apostrophes in the datastore

82 views
Skip to first unread message

bwa...@gmail.com

unread,
Dec 5, 2011, 10:21:20 PM12/5/11
to Google App Engine
I'm using GAE's Youtube API to retrieve video info. When either the
title or description contains an apostrophe, it gets cut off. For
example, if the title of the the video is "You'll love this", the only
thing that gets put in the datastore is "You". I've looked over all my
code and I can't figure out where this is happening. I guess my
question is, is this a known issue with GAE or the Youtube API?

Brandon Wirtz

unread,
Dec 5, 2011, 10:42:53 PM12/5/11
to google-a...@googlegroups.com
Are you escaping them?

Have you considered bytestrings?

--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengi...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.


bwa...@gmail.com

unread,
Dec 7, 2011, 8:54:31 PM12/7/11
to Google App Engine
I'm not escaping them. Is there a function that can do this for me?

I didn't know about bytestrings. I'll look them up.

Thanks!

On Dec 5, 10:42 pm, "Brandon Wirtz" <drak...@digerat.com> wrote:
> Are you escaping them?
>
> Have you considered bytestrings?
>
>
>
>
>
>
>
> -----Original Message-----
> From: google-a...@googlegroups.com
>

> [mailto:google-a...@googlegroups.com] On Behalf Of bwal...@gmail.com


> Sent: Monday, December 05, 2011 7:21 PM
> To: Google App Engine
> Subject: [google-appengine] Can't store strings with apostrophes in the
> datastore
>
> I'm using GAE's Youtube API to retrieve video info. When either the title or

> description contains anapostrophe, it gets cut off. For example, if the

bwa...@gmail.com

unread,
Dec 12, 2011, 8:55:08 PM12/12/11
to Google App Engine
I tried escaping my string as well as using a bytestring instead of a
string but neither worked. Is there any way to fix this?

Tim Hoffman

unread,
Dec 12, 2011, 11:45:23 PM12/12/11
to google-a...@googlegroups.com
HI

I store apostrophe's in the datastore all the time.

You should first check the strings as you get it out of Youtube. 

Log them, or try intreractively through the interpreter without appengine in the way, or use pdb, then
set breakpoints all the way to just before you put the record and see if you still have the full string.

Rgds

Tim

Brandon Wirtz

unread,
Dec 13, 2011, 12:16:21 AM12/13/11
to google-a...@googlegroups.com

ByteString should store anything you want.   I have had issues with Unitype Strings and non-unitype characters.

--

You received this message because you are subscribed to the Google Groups "Google App Engine" group.

To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/Yg61UxFA5nAJ.

Reply all
Reply to author
Forward
0 new messages