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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:30:03+00:00 2026-06-13T11:30:03+00:00

I now work on a web-base PHP app to work with a MySQL Server

  • 0

I now work on a web-base PHP app to work with a MySQL Server database .
database is with Latin1 Character set and all Persian texts don’t show properly .
database is used with a windows software Show and Save Persian texts good .
I don’t want to change the charset because windows software work with that charset .

Question:
how can convert latin1 to utf8 to show and utf8 to latin1 for saving from my web-base PHP app , or using Persian/Arabic language on a latin1 charset database without problem ?

note:
one of my texts is احمد رحمانی when save from my windows-based software save as ÇÍãÏ ÑÍãÇäí and still show with احمد رحمانی in my old windows-based software

image : image of database , charsets,collation and windows-based software (full Size)
image of database , charsets,collation and windows-based software

  • 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-13T11:30:04+00:00Added an answer on June 13, 2026 at 11:30 am

    Edit: Your screenshot shows that the diagnosis below is probably correct.

    What to do: Try using iconv() in your PHP web application. You would have to guess or find out what collation/codepage your Windows app uses.

    Then something like this might work:

    $string_decoded =  iconv("windows-1256", "utf-8", $string); 
    

    You may need to experiment to get this working. Also, I think you need to force your database connection to use latin1 instead of UTF-8!

    If you ask me, this is not a good basis for your web app. You would have to convert data into a broken format all the time. You may have to break compatibility with your application, or write an import tool.

    The latin1 character set does not cover Persian characters. Proof at collation-charts.org

    The only explanation I have why your Delphi program is able to store Arabic characters in a latin1 database is, it could be misusing the latin1 database to store data that isn’t covered by latin1, e.g. Windows-1256 Arabic. So the program would store the raw bytes of each arabic character, while in fact these bytes are occupied by other, latin characters in the latin1 character set. But as long as was only the Delphi program storing and fetching the data, no one noticed.

    If I’m correct in that – it’s the only way I can see how what you describe could be happening – that works as long as only applications are involved that do this the same way, a way which is wrong really.

    You should be able to confirm whether this is the case by looking at the data from a "neutral" database tool like phpMyAdmin or HeidiSQL. If you see garbage there instead of Arabic / Persian characters, I may be right.

    As to what to do to make your PHP web app work with the same database as your Delphi app – I’m not really sure what to do to be honest. As far as I know, there is no way to force mySQL to use one encoding instead of the other. You would have to manually "re-encode" the data before fetching it into your web app. This is likely to be a painful process.

    But first, try to find out what exactly is happening.

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

Sidebar

Related Questions

now I can make it work with user-profile.tpl.php page,all this page does is to
i have simple app the gets all the links from web page , im
I have developed a web app a year ago aimed to work with IIS6.
At this moment I start work on small web application based on MVC. Now
I'm starting work on a small java web app sitting on Oracle 10g. The
There are lots of Fluent implementations out there now that work with Lambdas to
We have been discussing this at work and now I am even more confused
I work with my own projects and every-now-and-then I do some work for third-parties
Right now I'm trying desperately to get @font-face to work in my website. This
I have to work with an existing DB and right now I have to

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.