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

  • Home
  • SEARCH
  • 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 7844765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:59:46+00:00 2026-06-02T16:59:46+00:00

I have always used rawurlencode to store user entered data into my mysql databases.

  • 0

I have always used rawurlencode to store user entered data into my mysql databases. The main reason I do this is so that stroing foreign characters is very simple I find. I’d then use rawurldecode to retrieve and display the data.

I read somewhere that rawurlencode was not meant for this purpose. Are there any disadvantages to what I’m doing?


So let’s say I have a German address with many characters like umlauts etc. What is the simplest way to store this in a mysql database with no risks of it coming out wrong and being searchable using a search script? So far rawurelencode has been excellent for our system. Perhaps the practise can be improved upon by only encoding foreign letters and not common characters like spaces etc, which is a waste of space I totally agree.

  • 1 1 Answer
  • 0 Views
  • 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-06-02T16:59:47+00:00Added an answer on June 2, 2026 at 4:59 pm

    Drawbacks I can think of:

    • Waste of disk space.
    • Waste of CPU cycles encoding and decoding on every read and every write.
    • Additional complexity (you can’t even inspect data with a MySQL client).
    • Impossibility to use full text searches.
    • URL encoding is not necessarily unique (there’re at least two RFCs). It may not lead to data loss but it can lead to duplicate data (e.g., unique indexes where two rows actually contain the same piece of data).
    • You can accidentally encode a non-string piece of data such as a date: 2012-04-20%2013%3A23%3A00

    But the main consideration is that such technique is completely arbitrary and unnecessary since MySQL doesn’t have the least problem storing the complete Unicode catalogue. You could also decide to swap e’s and o’s in all strings: Holle, werdl!. Your app would run fine but it would not provide any added value.

    Update: As Your Common Sense points out, a SQL clause as basic as ORDER BYis no longer usable. It’s not that international chars will be ignored; you’ll basically get an arbitrary sort order based on the ASCII code of the % and hexadecimal characters. If you can’t SELECT * FROM city ORDER BY city_name reliably, you’ve rendered your DB useless.

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

Sidebar

Related Questions

I have a class that is used to insert data into the database, and
We have always had languages that were preferable to be used in a particular
I have always used XML for returning data from my servlets and i have
I'm using MS SQL for a project, but have always used MySql in the
I have always used this code to donwload the html source from a web
Traditionally I have always used an ID column in SQL (mostly mysql and postgresql).
I have always used relative paths in PHP. Last time I have realized that
I have always used the Visual Studio Dependencies option to ensure that, for example,
It's my first time using PostgreSQL 8.4.2 with Django(I have always used MySQL or
I have always used: serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); which means that I will accept connections

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.