RTC Forums
November 24, 2024, 08:02:48 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Login
Register
RTC Forums
>
Subscription
>
Support
>
how to display chinese in browser.
Pages: [
1
]
« previous
next »
Print
Author
Topic: how to display chinese in browser. (Read 4481 times)
xalion
RTC Expired
Posts: 6
how to display chinese in browser.
«
on:
December 17, 2012, 11:21:24 AM »
with Sender as TRtcDataServer do
if Request.Complete then
begin
Write('你好');
end;
when I open in browser, it display ??.
how to display chinese in browser?
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: how to display chinese in browser.
«
Reply #1 on:
December 17, 2012, 11:32:21 AM »
You can not send Unicode characters out directly with the Write method. You need to properly encode your Unicode content. If you are using UTF-8 encoding, you can do it by using the function Utf8Encode (returns encoded String) or Utf8EncodeEx (returns encoded byte array).
For example:
with Sender as TRtcDataServer do
if Request.Complete then
begin
WriteEx(
Utf8EncodeEx
( '你好' ) );
end;
Another way would be to use HTML escape sequences with character codes. In that case, the encoding of your HTML page is not important.
Best Regards,
Danijel Tkalce
Logged
xalion
RTC Expired
Posts: 6
Re: how to display chinese in browser.
«
Reply #2 on:
December 17, 2012, 02:24:31 PM »
Thank you. it works now.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...