BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Html Unicode, pls help. Thanks.

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi XML
View previous topic :: View next topic  
Author Message
Oscar
Guest





PostPosted: Thu Apr 13, 2006 4:05 am    Post subject: Html Unicode, pls help. Thanks. Reply with 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.


====
<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





PostPosted: Thu Apr 13, 2006 9:03 am    Post subject: Re: Html Unicode, pls help. Thanks. Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi XML All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.