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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:12:55+00:00 2026-05-23T07:12:55+00:00

Relevent code: $status = $db->run( INSERT INTO user_wall (accountID, fromID, text, datetime) VALUES (:toID,

  • 0

Relevent code:

$status = $db->run(
    "INSERT INTO user_wall (accountID, fromID, text, datetime) VALUES (:toID, :fromID, :text, '" . time() . "')",
    array(":toID" => $toID, ":fromID" => %accountID, ":text" => $text)
);

I am taking input text from javascript, throwing it in an AJAX call to handle it, which calls a function which includes these lines of code.

The text string in question is: “Türkçe Türkçe Türkçe!“

Upon investigating the database, the following value is saved “Türkçe Türkçe Türkçe!“, which is double utf8_encode’d.

When viewing the text by SELECTing it from the database, I get “Türkçe Türkçe Türkçe!“, which is how they should be saved in the database in the first place.

As far as I know, I am not encoding the data as it is being prepared by PDO…

  • 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-23T07:12:56+00:00Added an answer on May 23, 2026 at 7:12 am

    Encoding is a b*tch. You need to make sure it is as you expect it to be in several places:

    1. The HTML page with the Javascript. Set it to utf-8 with a meta tag like:
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    2. The connection to your database. Execute the query set names 'utf8' after connecting to the database (and before any other queries).

    3. Your database field. In MySQL it’s called a collation set it to utf8_general_ci (ci stands for case-insensitive).

    If you have these 3 your data should always be, and stay, utf-8 (unless you’re doing encoding yourself).

    For good measure, make sure your source code files are utf-8 as well. Windows typically defaults to iso.

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

Sidebar

Related Questions

here is the relevent code snippet: public static Rand searchCount (int[] x) { int
I'm embedding MSBuild directly into a more complex build tool. The relevant code looks
I'm using CanCan and I've run into an error I'm having trouble diagnosing. Some
Here's the relevant code snippet. public static Territory[] assignTerri (Territory[] board, String[] colors) {
Here's the relevant code: public static void printBoarders (Territory x) { int t =
I'm having some trouble with the jQuery hover method. Here's the relevant JavaScript code:
I have a transparent BufferedImage created with the following code(not relevant how it is
Here's the relevant bit of the source code: class Dice { String name ;
I won't post any code, because there is too much that could be relevant.
The relevant snippet of HTML: <span class=a> <div class=fieldname>Question 1</div> <input type=text value= name=q1

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.