Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Asp.net and Postgresql

Posted on 2009-05-15
8
Medium Priority
?
734 Views
Last Modified: 2013-11-08
I have an asp.net 3.5 app using a postgresql database with sql_ascii encoding.  How do I configure my app to show strings with accentuation from DB?

After searching for a solution, I found that the encoding used by postgresql is always unicode (connection string = Server={0}; Port={1}; database={2}; Userid={3}; password={4}; Pooling=false; Timeout=20; Encoding=UNICODE",). If you use ASCII, it's ignored.

At the head section of my aspx page, I tried using
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

I inserted
    <globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" culture="pt-BR"/>
at my web.config file. I also tried
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="pt-BR"/>

None of this solved my problem. the accentuated character are shown as square characters.
0
Comment
Question by:jeovaalmeida
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 24403294
And what is symbol under square character?
Do you use custom font without sheriff / sans sheriff fallback?
Does this show up correctly :http://en.wikipedia.org/wiki/Portuguese_alphabet ?
0
 

Author Comment

by:jeovaalmeida
ID: 24411424
The characters shown as square (as big as lowercase characters) are those accentuated characters, at http://en.wikipedia.org/wiki/Portuguese_alphabet, at the line (3rd) that starts with "In addition, the following characters with diacritics are used " ...
The font used by my website is tahoma.
 >> Does this show up correctly :http://en.wikipedia.org/wiki/Portuguese_alphabet ?
I'm not sure if I understood your question correcty, but if you want to know if the characters of that page shows up correctly, the answer is yes.
0
 
LVL 62

Expert Comment

by:gheist
ID: 24411844
You have to install support for your region from windows to get characters displayed correctly in all fonts.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:jeovaalmeida
ID: 24411964
And how do I do that?
0
 
LVL 62

Expert Comment

by:gheist
ID: 24412004
CYou can have look at page source in your browser - do you get correct characters and encodings from server. Sometimes it is wrong server encoding header you never paid attention to.
0
 

Author Comment

by:jeovaalmeida
ID: 24413009
I clicked View >> Source Code. The HTML shows the squares, too.
Firefox has the "iso-8859-1" as an option for encoding option (View >> Encoding) . But even selecting this option the right characters aren't shown. (though the square character is changed by other strange one).
0
 
LVL 62

Expert Comment

by:gheist
ID: 24419387
So ASPnet gives squares.
0
 

Accepted Solution

by:
jeovaalmeida earned 0 total points
ID: 24435306
I found a solution: using the built in postgre database function
convert(fiedlName using windows_1250_to_utf8)
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question