Hi Everybody!!!

I am Working on Web application Using C#.NET(Microsoft Visual Studio) and SQL server 2005 ,Microsoft Internet Explorer .I have to show some Sanskrit text on web page.Now i am showing it using the Text Box control(as it show text as it is from database like paragraph...)

1.My Problem is that the text that i retried from database is not shown properly on web page .It shows some garbage values like boxes.I tried for different Fonts but still it doesn't show that text in properly.it's not readable,I used Microsoft Internet Explorer for out put .

2.If possible i have to test it on at least 2-3 browsers(Internet Explorer,Firefox,opera... )

3.Shall I change that Text Control,Is their any another control .
Or any other way to show text from data base with proper format.

Is any knows that Sanskrit Font which will work on this stuff. i have one sample with this...it's Sanskrit Slokas with some English meaning....... Please see the Attachment


Please help with this i done lot off google search and tried different fonts but they are not working...


thanks in advance for getting here......

Dani AI

Generated

A short, practical checklist that addresses the three common causes of “boxes” for Sanskrit (Devanagari) text — tied to ’s post and ’s Unicode hint.

The root causes

  • Wrong storage/encoding (database uses single-byte varchar or legacy-font bytes).
  • Page/HTTP charset mismatch (browser gets non-Unicode content).
  • No font with Devanagari glyphs on the client (or legacy-font text that only looks right with a specific legacy font).

Quick verification and fixes

  • Confirm SQL Server column types are Unicode (NVARCHAR/NCHAR/NTEXT). Example check:

    SELECT COLUMN_NAME, DATA_TYPE
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'YourTable';

    If columns are varchar, back up the table, add NVARCHAR columns and migrate data. If the stored bytes come from a legacy font (Kruti Dev/DevLys style), a mapping/conversion tool or re-entry will be required — changing column type alone won’t fix legacy encodings.

  • Ensure the web page and HTTP response declare UTF-8. In HTML and ASP.NET:

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    Response.ContentEncoding = System.Text.Encoding.UTF8;
    Response.Charset = "utf-8";
  • When inserting/reading from SQL Server use Unicode types/parameters:

    cmd.Parameters.Add(new SqlParameter("@text", SqlDbType.NVarChar) { Value = text });

Fonts and browser rendering

  • Boxes usually mean no glyphs available. Common Devanagari fonts: Mangal (Windows), Noto Sans Devanagari (Google), Lohit Devanagari, Arial Unicode MS. Include a Devanagari-capable font in CSS fallback or serve a licensed webfont:

    body { font-family: "Mangal", "Noto Sans Devanagari", serif; }
  • If text appears readable when a legacy font (e.g., Kruti Dev) is applied locally, the data is stored in that legacy encoding and must be converted to Unicode code points.

Summary
End-to-end Unicode is required: NVARCHAR storage + UTF‑8 page/headers + a Devanagari-capable font (or embedded webfont). Back up data before any conversion.

Recommended Answers

All 2 Replies

>To Show Sanskrit Font Properly on Web Page.....

Use UniCode Fonts.

Thanks for your Replay........

But still that problem is not Solved .
It doesn't text in proper format .It must be readable.that not a single font work with this .And this is my main task to show that on web page.IS their any other way to get out from this problem.

Please help me in this .I know some on e may know that how to deal with Sanskrit Fonts.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.