SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    %20 is added to all whitespaces when i retrieve the data from db

    Hi
    i'm not sure if this is the right place to post

    i made this blog (with java and mysql) and when i enter text and submit, this happens:

    what i submit:
    a b c d
    what is displayed after submission and retrieve from database:
    a%20b%20c%20d

    from where should i start in order to solve this?

    using charset=iso-8859-1 in my jsp and latin-1 in mysql

  2. #2
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i forgot to say that, if a want to post in the blog and have the text correctly output afterwards, i copy the text i input, then submit, then edit the retrieved text (the one with %20 chars added) and over it i paste the original text, submit (edit), getting it done now without any errors

  3. #3
    Word Painter silver trophy Shyflower's Avatar
    Join Date
    Oct 2003
    Location
    Winona, MN USA
    Posts
    10,053
    Mentioned
    142 Post(s)
    Tagged
    2 Thread(s)
    the %20 is the space. If you want to get rid of that you either need to mark the spaces with a dash or underscore or take the spaces out altogether in your url. Depending upon your blog platform, it should tell you how to make "friendly urls", using your htaccess file, to display without the %20 space markers.
    Linda Jenkinson
    "Say what you mean. Mean what you say. But don't say it mean." ~Unknown

  4. #4
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shyflower: its not in the url, its in the main blog's textarea where the %20 makes its appearance

  5. #5
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have a look here at topics with title "teste":

    http://rsacramento.no-ip.org/Blog

  6. #6
    Word Painter silver trophy Shyflower's Avatar
    Join Date
    Oct 2003
    Location
    Winona, MN USA
    Posts
    10,053
    Mentioned
    142 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by rfl View Post
    have a look here at topics with title "teste":

    http://rsacramento.no-ip.org/Blog
    I looked at the link you left and didn't see any %20 markers in Google Chrome browser.

    Oops... yes I did. Just a minute!
    Linda Jenkinson
    "Say what you mean. Mean what you say. But don't say it mean." ~Unknown

  7. #7
    Word Painter silver trophy Shyflower's Avatar
    Join Date
    Oct 2003
    Location
    Winona, MN USA
    Posts
    10,053
    Mentioned
    142 Post(s)
    Tagged
    2 Thread(s)
    Those markers are in your source code so I imagine your blog platform's rich text editor is putting them in there. What blog platform are you using?

    This can also happen when you copy paste from a Word document to a rich text editor. The easiest way to get rid of them is to change from rich text to straight html, which is something you can do in most blog platforms (at least the ones I have used).
    Linda Jenkinson
    "Say what you mean. Mean what you say. But don't say it mean." ~Unknown

  8. #8
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the blog was built from scratch by me, using java and mysql, so no rich text editor or whatsoever
    as i said above, if i want it nice, i copy the original text, submit, then edit - paste over, submit again -> pls see the example in the link i gave above

  9. #9
    Word Painter silver trophy Shyflower's Avatar
    Join Date
    Oct 2003
    Location
    Winona, MN USA
    Posts
    10,053
    Mentioned
    142 Post(s)
    Tagged
    2 Thread(s)
    I'm not tech oriented, but I don't think this is a MySQL problem so I'm going to move this thread again then to general application and design, which is a programming forum. Maybe someone there will be able to help you. Good luck. Sorry I couldn't help more.
    Linda Jenkinson
    "Say what you mean. Mean what you say. But don't say it mean." ~Unknown

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,333
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Off Topic:

    The link seems not to be working now.

  11. #11
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    site is up again
    sorry for the inconvenience

  12. #12
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    never mind: i partially recoded the app and now it works fine

  13. #13
    Word Painter silver trophy Shyflower's Avatar
    Join Date
    Oct 2003
    Location
    Winona, MN USA
    Posts
    10,053
    Mentioned
    142 Post(s)
    Tagged
    2 Thread(s)
    Sorry no one could help you out. Don't give up on us! Hopefully next time we'll do better.
    Linda Jenkinson
    "Say what you mean. Mean what you say. But don't say it mean." ~Unknown


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •