Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using varchar type of field and manully it allows to insert urdu text but when i add it by form then ???? value are inserted in the table fields are ?????? how can i proper inserted it
Posted
Updated 14-Sep-20 21:36pm

try using this

SQL
VARCHAR(n) CHARSET ucs2
 
Share this answer
 
Hi

Varchar type of field allow you insert any type of data in database it will easily save your Form Field either you are writing in English, Urdu , Arabic etc.
 
Share this answer
 
Urdu has a different encoding and decoding of the string data and thus when saving it the data must be saved in a form that once extract it must be the same Urdu encoding for you to get.

The only thing you should do is, if the database isn't allowing any setting and you're still getting this error, then try saving the bytes of the data.

But remember, Unicode encoding is the only encoding that allows the worldly languages, other character sets allow only English. That is why, your entire encoding of character set must be changed to Unicode. It is the same encoding that is set for the HTML document etc. This tells the environment (software application) that the document that is provided is/and must be formatted according to the Unicode standards.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 15-Sep-14 23:49pm    
There is no such thing as "UTF encoding". There are several UTFs. Well, perhaps this is just inaccurate wording.
But the statement about non-UTF (more correctly, encodings not based on Unicode) — only English — is absolutely not true.
—SA
Afzaal Ahmad Zeeshan 16-Sep-14 1:20am    
Ok, so how will you explain this function in .Net Framework.

byte[] bytes = new UTF8Encoding(true).GetBytes("love for all, hatred for none!");

..let me tell. This means, that the bytes to get from the string, is written in UTF-8 encoding. Hopefully, I might have missed a point in explaining this function.
Afzaal Ahmad Zeeshan 16-Sep-14 1:22am    
However, agree to be wrong. :-) I didn't mean UTF at itself, it was the unicode..silly me!
Sergey Alexandrovich Kryukov 16-Sep-14 1:51am    
As I assumed, it was just awkward warning, but it's better to work the way not confusing some less experienced readers.
Bigger problem is other, non-Unicode encodings. The principles are different, but there are many non-Unicode encodings supporting non-English characters. In most cases, they support Latin + some other script.
—SA
Asim Shahid 15-Sep-14 23:51pm    
kindly guide me how can i tell my software application that the document that is provided must be formatted according to the utf standards ??
To support Urdu, you need Unicode support. .NET is totally based on Unicode; and you need to take care of MySQL support.
Please read this part of MySQL documentation: http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html[^].

Note that only the BMP is supported, but all code points used by Urdu are in BMP: http://en.wikipedia.org/wiki/Urdu_alphabet[^].

See also: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html[^].

—SA
 
Share this answer
 
Comments
[no name] 16-Sep-14 7:40am    
using nVarchar type allow to add text writing in Arabic, English and Urdu.
Sergey Alexandrovich Kryukov 16-Sep-14 9:43am    
Correct, but there this type is available.
In MySQL, however, it could be
VARCHAR(n) CHARSET utf8.
—SA
[no name] 17-Sep-14 1:39am    
use this
VARCHAR(n) CHARSET ucs2
Sergey Alexandrovich Kryukov 17-Sep-14 1:52am    
Why not utf8?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900