473,785 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why are these caracters not being display correct

Jon
Hello all,

In my code im using Response.Write( someText) to write out some Japanese text
to a new browser window. In the command window, the text is correct, but when
the browser window opens it appears as ャー㠮エ゠¢æ*œã.

Why would this be so? My code is below:

Response.ClearH eaders();
Response.ClearC ontent();
Response.Buffer = true;
Response.Append Header("content-length", strResponse.Len gth.ToString()) ;
Response.Append Header("content-disposition", "attachment;fil ename=Online
Form Results " + IDToDisplay.ToS tring()+ ".html");

Response.Conten tType = "text/html";
Response.Conten tEncoding = System.Text.Enc oding.UTF8;
Response.Expire s = 0;
Response.Write( strResponse);

Response.End();

Thanks all for help.

JY
Aug 25 '06 #1
4 3185
You may not be able to cant display Japanese textbwith UTF-8 encoding.
you'll need to use a japanese charset such as

<meta http-equiv="content-type" content="text/html; charset=Shift_J IS">

http://msdn2.microsoft.com/en-us/lib....codepage.aspx

I've never tried it but it may be
Response.Conten tEncoding = Encoding.GetEnc oding("SHIFT-JIS")

Regards

John Timney (MVP)
"Jon" <Jo*@discussion s.microsoft.com wrote in message
news:CD******** *************** ***********@mic rosoft.com...
Hello all,

In my code im using Response.Write( someText) to write out some Japanese
text
to a new browser window. In the command window, the text is correct, but
when
the browser window opens it appears as ffの,, Soき.

Why would this be so? My code is below:

Response.ClearH eaders();
Response.ClearC ontent();
Response.Buffer = true;
Response.Append Header("content-length", strResponse.Len gth.ToString()) ;
Response.Append Header("content-disposition", "attachment;fil ename=Online
Form Results " + IDToDisplay.ToS tring()+ ".html");

Response.Conten tType = "text/html";
Response.Conten tEncoding = System.Text.Enc oding.UTF8;
Response.Expire s = 0;
Response.Write( strResponse);

Response.End();

Thanks all for help.

JY

Aug 25 '06 #2
Thus wrote John,
You may not be able to cant display Japanese textbwith UTF-8 encoding.
you'll need to use a japanese charset such as

<meta http-equiv="content-type" content="text/html;
charset=Shift_J IS">

http://msdn2.microsoft.com/en-us/lib...oding.codepage
.aspx

I've never tried it but it may be
Response.Conten tEncoding = Encoding.GetEnc oding("SHIFT-JIS")
Regards
UTF-8 is a *Unicode* Tranformation Format and thus has no problems encoding
Japanese characters.

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de
Aug 25 '06 #3
Thus wrote Jon,
Hello all,

In my code im using Response.Write( someText) to write out some
Japanese text to a new browser window. In the command window, the text
is correct, but when the browser window opens it appears as
ャーのエア 抜き.

Why would this be so? My code is below:

Response.ClearH eaders();
Response.ClearC ontent();
Response.Buffer = true;
Response.Append Header("content-length",
strResponse.Len gth.ToString()) ;
That's not the true Content-Length. Its value may be greater than the string
length.
Response.Append Header("content-disposition",
"attachment;fil ename=Online
Form Results " + IDToDisplay.ToS tring()+ ".html");
Response.Conten tType = "text/html";
Response.Conten tEncoding = System.Text.Enc oding.UTF8;
Did you check whether the browser did pick up the correct encoding (UTF-8)
from the HTTP response?

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de
Aug 25 '06 #4
I never knew that Joerg. Thanks for correcting me.

Regards

John Timney (MVP)
"Joerg Jooss" <ne********@joe rgjooss.dewrote in message
news:94******** *************** ***@msnews.micr osoft.com...
Thus wrote John,
>You may not be able to cant display Japanese textbwith UTF-8 encoding.
you'll need to use a japanese charset such as

<meta http-equiv="content-type" content="text/html;
charset=Shift_ JIS">

http://msdn2.microsoft.com/en-us/lib...oding.codepage
.aspx

I've never tried it but it may be
Response.Conte ntEncoding = Encoding.GetEnc oding("SHIFT-JIS")
Regards

UTF-8 is a *Unicode* Tranformation Format and thus has no problems
encoding Japanese characters.
Cheers,
--
Joerg Jooss
ne********@joer gjooss.de


Aug 25 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
1507
by: Eric J. Holtman | last post by:
I feel like the answer to this should be blinding obvious. I also feel like it's probably an exercise in an undergraduate database design course. I'm off to google for an answer, but I figure I'd throw it out here to see if there's a quick and dirty solution. I have in my database a table of every position we have here called Holdings. It would be equivalent to an Inventory table in every basic design course. There are many users...
33
6636
by: selowitch | last post by:
I've been searching in vain for a way to present typographically correct fractions (not resorting to <sup> and <sub> tags) but have been frustrated by the fact that the glyphs for one-half, one-eighth, three-quarters, etc. do not display in the correct typeface (or even consistently the same typeface) and seem totally resistant to attempt to fix this through CSS: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"...
6
27643
by: Nawab | last post by:
Hey can anyone explain to me the difference between Mid and Mid$ ....i notice sometimes when i a running the update query with Mid$ it tells me that for example 3 records will be updated ( which in theory is the right amount based on the example) however sometimes only two records are updated! Also in the Mid function i am not specifying the last argument because I need the remainder of the string example Mid(, 4) i am doing this...
1
1876
by: Fabiano | last post by:
Please, i got an XML String that contains some special caracters like linefeed, tab and others. How can i replace this chars? Can i use an ASCII value at the XXX.replace() method? Tks in adv. Fabiano
2
3701
by: David Scemama | last post by:
Hi, I'm looking for a way to display semi graphic characters in a multi line text control or in a rich text control. I've tried with all the characters of the extended ASCII table (code page 437), they appear correctly except the semi graphic ones. Please help ... Thanks a lot
2
5191
by: alain.hogue | last post by:
I have a table "tblCards" with a field "Titre" that contain french words (Hbert, Gagn, Hlne, etc....) in an database with SQLEXPRESS 2005. I have used the asp:SqlDataSource to filter the SELECT statement according to a Textbox the user can type into. When used with the LIKE condition using any acute caracters the SELECT statement return nothing, unless the acute caracters is replaced with an ampersand "%". Even the underscore "_"...
7
1910
by: arno | last post by:
Hi, I want to search a substring within a string : fonction (str, substr) { if (str.search(substr) != -1) { // do something } }
3
1610
by: max3 | last post by:
Step Description of Task Remark 1 Create a class to represent the student This class is to define the following data items: o declare the variables required to store the data of one student (id, name, surname, group) assign default values to each of these variables 2 Create a number of methods in this class to be able to: o set the values (set methods) for each of these variables from another class o return the values of individual ...
1
1954
by: natural | last post by:
Good Day. I am currently via Form send data to a word template.. I have about 150 bookmarks in a word document which was previously imported via a simular document. and appended into my DB. The data changes etc we export it back for various reasons. I use the following Code: --------------------------------------------------------------------------------
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10097
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8983
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7505
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.