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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:48:50+00:00 2026-05-27T11:48:50+00:00

I am trying to store some text (e.g. č ) in a Postgres database,

  • 0

I am trying to store some text (e.g. č) in a Postgres database, however when retrieving this value, it appears on screen as ?. I’m not sure why it does this, I was under the impression that it was a character that wasn’t supported in UTF-8, but was in UTF-8, however, judging by the first answer, this is an incorrect assumption.

Original question (which may still be valid):

I have read about UTF-8 Surrogate pairs, which may achieve what I
require, and I’ve seen a few examples involving the stringinfo
object TextElementEnumerators, but I couldn’t work out a practical
proof of concept.

Can someone provide an example of how you would write and read UTF-16
(probably using this surrogate pair concept) to a postgres database.
Thank you.

Updated question:
Why would the č character be returned from the database as a question mark?

We use NPGSQL to access the database and VB.Net.

  • 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-27T11:48:51+00:00Added an answer on May 27, 2026 at 11:48 am

    There’s no such thing as a character which exists in UTF-16 but not UTF-8. Both are capable of encoding all of Unicode. In other words, if you can get UTF-8 to work, it should be able to store any valid Unicode text.

    EDIT: Surrogate pairs are actually a feature of UTF-16 rather than UTF-8. They allow a character which isn’t in the basic multi-lingual plane (BMP) to be represented as two UTF-16 code units. Basically, UTF-16 is often treated as a fixed-width encoding (exactly two bytes per Unicode character) but that only allows the BMP to be encoded cleanly. Surrogate pairs are a (fairly hacky) way of extending the range beyond the BMP.

    I very much doubt that the character you’re trying to represent is outside the BMP, so I suspect you need to look elsewhere for the problem. In particular, it’s worth dumping the exact character values of the text (e.g. by casting each char to int) before it goes into the database and after you’ve fetched it. Ideally, do this in a short but complete console app.

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

Sidebar

Related Questions

i am trying to store Chinese character in mysql database,but it store some messy
Hi friends. I'm trying to store some data into a 2-table-database. Here is its
I'm trying to select some fields from my database and store them as a
I am trying to store some parsed feed contents values in Sqlite database table
I'm trying to design some tables to store some data, which has to be
I'm trying to store the names of some variables inside strings. For example: Dim
I am trying to optimize some stored procedures on a SQL Server 2000 database
I am trying to store an xml value in my app.config file. The app.config
I have some simple text file. I am trying to read that file contents
I am trying to figureout the best solution to store html data in some

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.