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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:58:52+00:00 2026-06-05T16:58:52+00:00

I am having a problem when i update an entry in my postgresql database,

  • 0

I am having a problem when i update an entry in my postgresql database, it converts my charcters to the wrong format. The way I update is:

use Encode;
...
$user_name = escapeSql($user_name); # a statement that to doese this: line 1: $s =~ s/\?/_/g; and line 2: $s =~ s/\*/%/g;
$user_name = decode("utf-8", $user_name);
...
$statement = "UPDATE person SET name='".$user_name."', email='".$user_email."' WHERE id='".$user_id."'"; # The real statement have some more attributes, buts its the name that errors.
print STDERR "Statement: ". $statement;
$sth = $dbh->prepare($statement);
$result = $sth->execute();

As you see, I print out the statement to check the user_name looks like it should and here is what it looks like:
enter image description here

As you can see its says “Thør Åstrüp Pédersen” which is my name where i have replaced some chars with the special chars im trying to insert/update my entry to. Now the big problem which i have been debugging for some days now, is when i make a select statement on the database and fetch my user_name to see if the new name (entered in a web-GUI using dojo) was changed and updated correctly.. but it looks like:

enter image description here

I simply cannot figure out why my database dose that or how i, in any way, could check what charcter encoding the database is set to and make the right conversion. But then again, it looks good in PERL since the error log outputs it correctly (as showen above in the first img), but the PostgreSQL database hates it and converts it for some reason to crappy chars.

I really hope someone can help, even though its not the first time i have met encoding problems.. but the first time I couldn’t figure out since it looks like its a PostgreSQL thing and not Perl or PHP problem.

  • 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-05T16:58:54+00:00Added an answer on June 5, 2026 at 4:58 pm

    You can check your database encoding via issuing \l in psql prompt. You can also check your client encoding with ‘show client_encoding;’

    It’s maybe better to recreate database in UTF8. Everything about encodings in PostgreSQL is explained in the manual.

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

Sidebar

Related Questions

I am having a binding update problem with my ComboBox. My ComboBox's ItemSource is
UPDATE: Problem located in my related question - Nokogiri performance problem I am having
I am having problem updating my mysql in my web application.. I can't Update
I'm having a problem with running a custom function within an Access database. Currently,
I'm having a problem with my update script. Basically I enter values into textboxes
I am having problems using the update method of scala.collection.immutable.HashMap.I don't see the reason
I have a website that is updated regularly and I am having a problem
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
Im having problem in my UIscrollView ,this is what I have done: Whenever a
I am having problem using mvc:resources in spring 3.1 configuration. Initially i was working

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.