 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Oscar Guest
|
Posted: Thu Apr 13, 2006 4:05 am Post subject: Html Unicode, pls help. Thanks. |
|
|
I Want To Do A Encode/Decode The Multilangua(Chinese,Japanese) To Html
Unicode. I Found 'Encode Function'
(http://www.csie.ntu.edu.tw/~piaip/unihtml/) , But That Used A
JavaScript Write(On Bottom). I Already Try, But I Don't How To Convert
To Delphi Function.
AnyOne Can Help ? And How About 'Unicode Html Decode' Functions ? Where
I Can Find This Convertor Functions ? Hope Help. Thanks.
====
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-9" />
<title>HTML unicode</title>
<script type="text/javascript">
<!--
function convert()
{
str = document.conv.str.value;
result = "";
for(i = 0 ; i < str.length ; i++) {
c = str.charAt(i);
if((' ' <= c && c <= '~') || (c == '\r') || (c == '\n')) {
if(c == '&') {
cstr = "&";
} else if(c == '<') {
cstr = "<";
} else if(c == '>') {
cstr = ">";
} else {
cstr = c.toString();
}
} else {
cstr = "&#" + c.charCodeAt().toString() + ";";
}
result = result + cstr;
}
document.conv.result.value = result;
document.conv.result.focus();
document.conv.result.select();
return 0;
}
-->
</script>
</head>
<body> |
|
| Back to top |
|
 |
Ralf Junker - http://www. Guest
|
Posted: Thu Apr 13, 2006 9:03 am Post subject: Re: Html Unicode, pls help. Thanks. |
|
|
Hello Oscar,
you are looking for HTML entity encoding / decoding. DIHtmlParser does that:
http://www.yunqa.de/delphi/htmlparser/
For plain HTML writing, look at the TDIUnicodeHtmlWriter class.
To read and rewrite HTML, look at the DIHtmlParser_WriterPlugin demo.
To add Chinese and Japanes character encodings to DIHtmlParser, you can link it
against DIConverters, using the provided Use_DIConverters precompiled DCUs.
If you have further questions, please contact support via e-mail.
Regards,
Ralf
| Quote: | I Want To Do A Encode/Decode The Multilangua(Chinese,Japanese) To Html
Unicode. I Found 'Encode Function'
(http://www.csie.ntu.edu.tw/~piaip/unihtml/) , But That Used A
JavaScript Write(On Bottom). I Already Try, But I Don't How To Convert
To Delphi Function.
AnyOne Can Help ? And How About 'Unicode Html Decode' Functions ? Where
I Can Find This Convertor Functions ? Hope Help. Thanks.
|
---
The Delphi Inspiration
http://www.yunqa.de/delphi/ |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|