473,323 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

How can i get rigtht base64Encode for Russian Language use C#?

Dear friend,Now ,i am writing a Smtp Client. but there have problem
bother me that it is send Russian Language Html ,Mail is found identify code
like "??" in mailBody.

Mail source content,that it is Russian language HTML Page:
----------------------------------------------------------------------------
----------------------------------------------

<html>
<title>Decorate Your Store, Increase Sales and Win Great Prizes</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<body bgcolor="#CCCCCC" text="#CCCCCC">
<p><font color="#FFFF00" size="2" face="Arial, Helvetica, sans-serif"> Óâàæ
àåìû?Ïàðòíåðû ASUS, </font>
</p>
</body>
</html>
----------------------------------------------------------------------------
----------------------------------------------
I use method in c# to convert is :

Convert.ToBase64String(Encoding.GetEncoding("windo ws-1251").GetBytes(str));

get base64 is but isnt right:
----------------------------------------------------------------------------
----------------------------------------------
Content-Type: text/html;
charset="windows-1251"
Content-Transfer-Encoding: base64

PGh0bWw+Cjx0aXRsZT5EZWNvcmF0ZSBZb3VyIFN0b3JlLCBJbm NyZWFzZSBTYWxlcyBhbmQgV2lu
IEdyZWF0IFByaXplczwvdGl0bGU+CjxtZXRhIGh0dHAtZXF1aX Y9IkNvbnRlbnQtVHlwZSIgY29u
dGVudD0idGV4dC9odG1sOyBjaGFyc2V0PXdpbmRvd3MtMTI1MS I+Cjxib2R5IGJnY29sb3I9IiND
Q0NDQ0MiIHRleHQ9IiNDQ0NDQ0MiPiAKPHA+PGZvbnQgY29sb3 I9IiNGRkZGMDAiIHNpemU9IjIi
IGZhY2U9IkFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYiPi A/Pz8/Pz8/Pz8gQVNVUywgPC9m
b250PiAKPC9wPgo8L2JvZHk+CjwvaHRtbD4=
----------------------------------------------------------------------------
----------------------------------------------
I use outlook to send same content get base64 is:
----------------------------------------------------------------------------
----------------------------------------------
Content-Type: text/html;
charset="windows-1251"
Content-Transfer-Encoding: base64

PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE 1MIDQuMCBUcmFuc2l0aW9uYWwv
L0VOIj4NCjxIVE1MPjxIRUFEPg0KPE1FVEEgaHR0cC1lcXVpdj 1Db250ZW50LVR5cGUgY29udGVu
dD0idGV4dC9odG1sOyBjaGFyc2V0PXdpbmRvd3MtMTI1MSI+DQ o8TUVUQSBjb250ZW50PSJNU0hU
TUwgNi4wMC4yODAwLjE0NzYiIG5hbWU9R0VORVJBVE9SPg0KPF NUWUxFPjwvU1RZTEU+DQo8L0hF
QUQ+DQo8Qk9EWSBiZ0NvbG9yPSNjMGMwYzA+DQo8RElWPg0KPF A+PEZPTlQgZmFjZT0iQXJpYWws
IEhlbHZldGljYSwgc2Fucy1zZXJpZiIgY29sb3I9I2ZmZmYwMC BzaXplPTI+0+Lg5uDl7PvlIA0K
z+Dw8u3l8PsgQVNVUywgPC9GT05UPjwvUD48L0RJVj48L0JPRF k+PC9IVE1MPg0K

------=_NextPart_000_0005_01C4DD57.576DE690--
----------------------------------------------------------------------------
----------------------------------------------

How can i get rigtht base64Encode for Russian Language use
C#??????????????????????????????????????
¡¡¡¡

Best Regards

¡¡¡¡¡¡¡¡¡¡¡¡ qushui_chen
qu*********@asus.com.cn
2004-12-09
Nov 16 '05 #1
1 2635
qushui_chen <qu*********@asus.com.cn.discuss> wrote:
Dear friend,Now ,i am writing a Smtp Client. but there have problem
bother me that it is send Russian Language Html ,Mail is found identify code
like "??" in mailBody.


<snip>

That suggests that you didn't correctly retrieve the string to start
with, I'm afraid. The code is fine.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

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

Similar topics

1
by: pkershaw | last post by:
I am trying to port software to Russian Win2K still using MBCS. Initial problem was failure of MFC class CFile to instantiate. Tried to work around using Win32 API calls OpenFile() and...
2
by: Derrick | last post by:
Is it possible? I installed all the language scripts on my XP box, can see russian chars in unicode xml file, but not chinese chars. See the same thing in tree view as when i look at xml file in...
1
by: Sonu | last post by:
Hello, I have a multilingual application, to which I am adding Russian. The prolem is that all the dialog boxes & Menus are showing junk characters instead of Cyrillics!! while my window contents...
3
by: Roger Withnell | last post by:
I am using ASP, VBScript and MSSQL Server. I do not understand the purpose of the VBS Codepage setting - <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> nor the meta tag - <meta...
0
by: Viktor Barasov | last post by:
I am searching for a web page where I can enter a new web page in russian language that should be visited by russian search engines/catalogs (like yahoo.ru) for indexing. Are there some...
9
by: Roger Withnell | last post by:
I've built a site in English and an now translating it into Russian. My html charset= utf-8 and my vbscript codepage is 65001. I'm using DreamWeaver. If there is a Javascript function in a...
8
by: Aleks Kleyn | last post by:
I use vb code to show information from SQL Server on the screen. I have Russian text in this data. Everything is fine, but when I save this information into file using code...
5
by: Hank Moss | last post by:
I've been able to get the <qelement and the CSS quotes property to work well together in English, but not in Russian or mixed Russian and English. I probably don't have a firm enough grasp of the...
4
by: bdv1983 | last post by:
Hello! I need to prepare a line for authorization on smtp.mail.ru, for this purpose I use command AUTH PLAIN <the coded line>. For example for authorization on test@mail.ru it is necessary to code a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.