Web Forms :: Convert Chinese To Pinyin?
Dec 9, 2010I would like to save convert Chinese characters to Pinyin in ASP.NET web form. Can it be done?
View 1 RepliesI would like to save convert Chinese characters to Pinyin in ASP.NET web form. Can it be done?
View 1 RepliesCan i create a textbox in which i can write chinese.
View 1 RepliesEarlier my text box was running on this Validation Expression="^[a-zA-Z'.s-]{1,80}$", to allow only alphabets, ' . s . Now my text box should be capable of taking Chinese characters as well, so I was learnt online to use this p{L} for unicode instead of a-zA-Z, and set EnableClientScript="false".
asp:RegularExpressionValidator ID="regexpName" runat="server" CssClass="failureNotification" ErrorMessage="No Special Characters allowed"
ControlToValidate="txtName" ValidationExpression="^[p{L}'.s-]{1,80}$" Display="Dynamic" meta:resourcekey="regexpNameResource1" EnableClientScript="false"
I have done both, but it doesn't work. My input values were like
1. John123 2. 汉语%^&
Both of these were accepted without any errors. But I expect only alphabets in english and chinese and ' . s - to be accepted as Name input.
I am using dynamic web site creation . When the name of the web site is Chinese (using Chinese characters) the web site fails.
Also in VS 2008 if I name the web site (in IIS) with Chinese chars it fails. How do I make sure that users can use Chinese chars in website name?
I am using dynamic web site creation . When the name of the web site is Chinese (using Chinese characters) the web site fails.
Also in VS 2008 if I name the web site (in IIS) with Chinese chars it fails.
I have a database that stores Chinese characters. This works fine. The code for this system is written in vbscript ASP. Here is a sample [URL]
I also access this database via ASP.NET but the characters do not come out in Chinese.
See here [URL]
Why does ASP work and ASP.NET not work?
The code to access the Chinese in ASP.NET is similar to:
query = "select * from myTable ....";
SqlDataAdapter da = new SqlDataAdapter(query, Yart.SQLServerConnections.SqlConnection);
DataSet ds = new DataSet();
da.Fill(ds, "paragraphs");
Response.Write((string)ds.Tables["paragraphs"].Rows[0]["chinese"]);
I am thinking it might be my cast to a string that is destroying the encoding perhaps?
Note that in both sample pages I have this tag:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
when I am searching for Title , my search is working properly for English Titles,But it is not working for the remaining languages like chinese,Tamil etc...,
for this I did following Configurations in .aspx page and web.config side.
.aspx file
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
I useed this tag.
web.config
<configuration>
<system.web>
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web>
</configuration>
I spent a couple days to try to find the solutions online. I am developing a web site which needs to display some Chinese characters. In the MasterPage, I put
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> in the <Head>.
In the MasterPage there are are navigation menus which are Chinese character. I have a web page Default.aspx which uses the MasterPage. In Default.aspx I have some <asp:Label>s which are Chinese characters. On the local computer, I can see all of the Chinese characters. But the problem is: after I ftp all of the files to my web server (DiscountAsp.Net), I only can see the Chinese characters in the MasterPage, I can not see the Chinese characters which belongs to the Default.aspx. Instead of Chinese characters, it displayed weird letters.
We have a requirement wherein we need to translate all dynamic pages(i.e database driven pages) to Chinese language. Does .NET provide any API for this, or there are third-party APIs for the same. Which third-party is best recommended?
View 2 RepliesI have chinese charters stored in a cocloumn . Whn i try to retive that value i need to N before the parameter . How will i give that.
My cose is as follows
String sQuery = "SELECT * FROM " + T_SMS + " " ;
sQuery += "WHERE " +F_ID_SMS + " = @" + F_ID_SMS + " AND " + F_KEY + " = @" + F_KEY;
try
{
SqlCommand myCommand = new SqlCommand(sQuery,this.cConnection) ;
SqlParameter[] arrParameters = this.makeSQLParametersUK() ;
for(int i = 0 ; i < arrParameters.Length ; i ++)
{
myCommand.Parameters.Add(arrParameters[i]) ;
}
if (this.isTransactionAvailable())
myCommand.Transaction=this.cTxn;
SqlDataReader myDataReader = myCommand.ExecuteReader() ;
while(myDataReader.Read())
{
///seting the values
}
myDataReader.Close() ;
}
catch(SqlException e)
{
throw e ;
}
and my makeSQLParametersUK code is as follows
SqlParameter[] arrSqlParameter = new SqlParameter[3] ;
try
{
arrSqlParameter[0] = new SqlParameter("@" + F_ID_SMS,this.getIdSmsNumCorto()) ;
arrSqlParameter[0].IsNullable = false ;
arrSqlParameter[1] = new SqlParameter("@" + F_KEY, this.getKey() +"'") ;
arrSqlParameter[1].IsNullable = false ;
}
catch(Exception ex)
{
}
I need to extract chinese characters from the query string in a ASP.NET web application.
When I tried it, I get "????" instead of the actual text. I know I need to decode it with UTF-8 but its doesnot work. I have used String text = System.Web.HttpUtility.UrlDecode(Request.QueryString["text"], System.Text.Encoding.UTF8);
I have a page that displays content retrieved from XML with no problems:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Fields>
<NamePrompt>名字</NamePrompt>
</Fields>
</Root>
Page encoding is set to GB18030 and it displays perfectly. However, when I retrieve inputted text from HttpContext.Current.Request.Form that's been entered with double-byte characters, the retrieved string contains unreadable characters. Single-byte characters are fine, obviously.
I've tried the following to no avail:
byte[] valueBytes = Encoding.UTF8.GetBytes(HttpContext.Current.Request.Form["fullName"]);
string value = Encoding.UTF8.GetString(valueBytes);
I don't see this problem with other double-byte languages like Japanese or Korean. How can I successfully retrieve double-byte characters from a page that's GB18030 encoded?
why i can't write a sql filter by chinese character like the following select name from ABC where name like ' %可%'
View 1 Replies(I am developing a website to crawl the other website content in ASP.NET . I am able to get the content correctly but how can I identify which language is used based on that content. For Ex. English, Hindi, Chinese, Japanese etc.
I used following code.
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(TextBox1.Text );
request.UserAgent = "A .NET Web Crawler";
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream);
string htmlText = reader.ReadToEnd();
I want to display Chinese character in text box in Ajax Update Panel. But now i am getting error message as below.
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
Timestamp: Sat, 5 Jun 2010 13:12:18 UTC
Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
|120|hiddenField|__VIEWSTA'.
Line: 4723
Char: 21
Code: 0
URI: http://localhost:49299/AjaxUpdatePanel_POC/ScriptResource.axd?d=3XOuuZZ2MfcURXoee7rr5ThP5lLnlnNeJICyXC4kvAlvTFaRC1PPvMdo2uBohcDHAQC0xjGp7pHhayPIPENy6QC-buEHEbZ83K4xcoXU6Ls1&t=ffffffffec2d9970
But I tried with without ajax update panel. it's working perfectly.
Default.aspx code:-
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
Am Saving the file in Excel format which contains Chinese letters using C#.NET.
The excel file saved successfully. But the Chinese words are messed up in excel file.
Code Used to Save is :-
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=" Test.xls");
[Code].....
It shows the exact output in website (脚宽 ). But after saving the file the excel file shows like this (脚宽) .
Ex: 脚宽 ----> 脚宽
I have a string I need to convert back to a date. I can call .ToString("yyyyMMdd") and get the string i want. My question is how can I convert that back into a date? I'm trying something like the following with no luck.
DateTime d;
var formatInfo = new DateTimeFormatInfo {ShortDatePattern = "yyyyMMdd"};
if (DateTime.TryParse(details.DetectionTime.Date, formatInfo, DateTimeStyles.None, out d))
{
lit.Text = d.ToShortTimeString(); //would like 07/30/2010 as the text
}
I've never used DateTimeFormatInfo before if that isn't obvious. Can someone point me in the right direction. I know I could probably use substring and create a new DateTime(y, m, d) etc... I'm just wondering since c# interpreted .ToString() correctly, if it can't derive a date from the very same string it output.
I have an example to convert pdf to images using GhostScript following this link:
[URL]convert pdf to images using GhostScript . So how can I do that better?
I found an article to convert doc to pdf :
[URL]
It using command prompt. Therefore I need to use .net to execute command prompt.
[code]....
Is it possible to convert flv to wmv using C#? and how its work?
View 3 Repliesi am using linq to sql using stored procedure and when i drag and drop the SP on my designer it generates the the following columns name .. (for make it simple i just delete the rest of the code)
[Code]....
in my code i try to add the BuildingId and i am getting this error
cannot convert from 'int?' to 'int' //error
[Code]....
if i go back to desiginer.cs and remove the System.Nullable then it works but i am trying to find a permanent solution, and in future if i add any new SP to the designer my changes is gone :(
Is there an example of coverting PDF fillable forms to text or xml thru asp.net code behind? Below is the senario: User fills out a fillable pdf form then submit. I'll receive the form as an attachment thru email. On my web application, a button is clicked to automatically convert pdf fillable form to text or xml then insert into database.
View 5 Repliesi want to convert any format of document to pdf document in asp.net
View 6 RepliesI need to develop a page that can convert a .pdf file to .doc file in asp.net with c#I tryed much but un-success till now
View 2 RepliesAs I want to convert many html forms into .aspx forms. Is there any way to do that..
View 4 Replies