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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:20:24+00:00 2026-05-26T10:20:24+00:00

I used SQLite3 to implement small application to read from or write to a

  • 0

I used SQLite3 to implement small application to read from or write to a database. Some records that need to be added to the database are Arabic texts and when they are stored to the database they converted to non-readable and non-understood texts. I use these APIs for write & read:

  • sqlite3_open
  • sqlite3_prepare
  • sqlite3_bind_text
  • sqlite3_step

What can I do to solve the 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-05-26T10:20:24+00:00Added an answer on May 26, 2026 at 10:20 am

    It is most likely that your text is in non-ASCII encoding. For example, in unicode.

    This is because ASCII table has only characters represented by integer numbers from 0 to 127. So there is nothing that can be used to represent Arabic letters. For example, Unicode is using five different ranges to represent Arabic language:

    • Arabic (0600—06FF, 224 characters)
    • Arabic Supplement (0750—077F, 48 characters)
    • Arabic Presentation Forms-A (FB50—FDFF, 608 characters)
    • Arabic Presentation Forms-B (FE70—FEFF, 140 characters)
    • Rumi Numeral Symbols (10E60—10E7F, 31 characters)

    And since there could be more letters/characters that a 8-bit value (char type, which has a length of 1 byte) would allow, wide character is used to represent some (or even all) of those letters.

    As a result, the length of the string in characters will be different from length of the string in bytes. My assumption is that when you use sqlite3_bind_text function, you pass a number of characters as a fourth parameter, whereas it should be a number of bytes. Or you could misinterpret this length when reading the string back from the database. The sqlite3_bind_text documentation is saying this about the fourth parameter:

    In those routines that have a fourth argument, its value is the number
    of bytes in the parameter. To be clear: the value is the number of
    bytes in the value, not the number of characters. If the fourth
    parameter is negative, the length of the string is the number of bytes
    up to the first zero terminator.

    Make sure you do the right thing there.

    See also:

    • Wide characters
    • Unicode
    • Arabic characters in Unicode

    Good luck!

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

Sidebar

Related Questions

I need to migrate information that I created in SQLite3 to a MySQL database
I am making a small iPhone application in which I have implemented the database
Does the sqlite3 .import command used to import data from delimited text files append
In development I used sqlite3 and I was writing a blog application. So for
Within my C# application, I've used the sqlite3 library for 32 bit architecture and
I'm using Python 2.6.4 and its module sqlite3 for a small database project and
Never used a cache like this before. The problem is that I want to
We used to use SourceSafe, and one thing I liked about it was that
I am using SQLite in a project used by an android application. Currently I
I started using a SQLite database in my android application. Very simple to use

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.