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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:47:59+00:00 2026-05-19T21:47:59+00:00

i realized when i used urlencode or rawurlencode in PHP encoding the simple character

  • 0

i realized when i used urlencode or rawurlencode in PHP encoding the simple character § (paragraph) i get the following result: “%C2%A7”.

But when i use escape in Javascript to encode that character, i get only “%A7”.

In this case i have encoding problems when sending/receiving data between the server running PHP and the javascript client trying to fetch the data via ajax/jquery.

I want to be able to write any type of text i want. For this i encode the text and send it to the backend php script, escaping the data and sending. When i retrieve it, on php side i take the data from mysql and do rawurlencode and send it back.

Both sides, work in UTF-8 mode. jquery ajax function is called with "contentType: application/x-www-form-urlencoded:charset=UTF-8", mysql server is set for UTF-8 both for client and server, and the php script starts echoing with header( "application/x-www-form-urlencoded:charset=UTF-8");

Why is PHP producing that %C2 thing, which generates the character  on javascript side.

Coult somebody help?

  • 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-05-19T21:47:59+00:00Added an answer on May 19, 2026 at 9:47 pm

    I had the same problem a while ago and found the solution :

    function rawurlencode (str) {
        str = (str+'').toString();        
        return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').
                                                                                        replace(/\)/g, '%29').replace(/\*/g, '%2A');
    }
    

    The code is taken from here – http://phpjs.org/functions/rawurlencode:501
    Hope it helps.

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

Sidebar

Related Questions

I realized I used a particular function over and over again in my PHP
I used reflection many times before on public methods, but I never realized that
I have always used relative paths in PHP. Last time I have realized that
Sorry but this is a concept that I never realized and I never used
I am extending my Object Property Value Diff but I realized if an object
My normal development platform for PHP is Linux. I use a Red hat server
I just realized that the C# property construct can also be used with a
I've long used cygwin's nm command for all my .lib symbol debugging needs, but
I used PSPad for my WordPress template and just now realized the DOCTYPE was
I just realized that SQL server '=' comparator when used for text comparison 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.