473,756 Members | 8,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Encoding to ISO-8859-1 problems

Hi,
We are trying to encode to ISO-8859-1, but we have problems doing it using
the encoders in .NET. We get some unknown characters in some culture which
comes out fine if we post (from IE) from a page in ISO-8859-1 to another
page using ISO-8859-1, but cannot take a .NET string or a UTF-8 string,
convert it in ISO-8859-1 and display it with this encoding using the same
content in the string...

Are there anyone that know how IE does it? Is there any correspondance
table, are the any information into the unicode encoding that says "this
character has this style and should convert to another character with this
style" or something like it?

Thanks

ThunderMusic
Feb 1 '07 #1
6 1686
ThunderMusic <No************ *************@N oSpAm.comwrote:
We are trying to encode to ISO-8859-1, but we have problems doing it using
the encoders in .NET. We get some unknown characters in some culture which
comes out fine if we post (from IE) from a page in ISO-8859-1 to another
page using ISO-8859-1, but cannot take a .NET string or a UTF-8 string,
convert it in ISO-8859-1 and display it with this encoding using the same
content in the string...

Are there anyone that know how IE does it? Is there any correspondance
table, are the any information into the unicode encoding that says "this
character has this style and should convert to another character with this
style" or something like it?
It's not very clear exactly what's going on. It's quite possible that
when you post in IE, it's not using 8859-1 for the post even if the
pages returned *are* genuinely using 8859-1. It's hard to see how it
would be displayed in that case though.

If a character isn't in 8859-1, you won't be able to represent it in
8859-1.

Do you *have* to use 8859-1 rather than an encoding which can represent
the whole of Unicode (eg UTF-8)?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 1 '07 #2
it's actually because we are sending mails to hotmail, and because our
application is in utf-8 and hotmail uses ISO-8859-1, so if we send a message
encoded using UTF-8, the displayed message comes out plain ugly in
hotmail...

So we must find a way to convert things correctly... to give an exemple of
what should be converted... a character like the oe (o and e tied together)
should be converted to ISO-8859-1 oe (o and e separatly) because the "tied
together" version does not exists in 8859-1...

Anyone knows how to do it seemlessly?

Thanks

ThunderMusic

"Jon Skeet [C# MVP]" <sk***@pobox.co mwrote in message
news:MP******** *************** *@msnews.micros oft.com...
ThunderMusic <No************ *************@N oSpAm.comwrote:
>We are trying to encode to ISO-8859-1, but we have problems doing it
using
the encoders in .NET. We get some unknown characters in some culture
which
comes out fine if we post (from IE) from a page in ISO-8859-1 to another
page using ISO-8859-1, but cannot take a .NET string or a UTF-8 string,
convert it in ISO-8859-1 and display it with this encoding using the same
content in the string...

Are there anyone that know how IE does it? Is there any correspondance
table, are the any information into the unicode encoding that says "this
character has this style and should convert to another character with
this
style" or something like it?

It's not very clear exactly what's going on. It's quite possible that
when you post in IE, it's not using 8859-1 for the post even if the
pages returned *are* genuinely using 8859-1. It's hard to see how it
would be displayed in that case though.

If a character isn't in 8859-1, you won't be able to represent it in
8859-1.

Do you *have* to use 8859-1 rather than an encoding which can represent
the whole of Unicode (eg UTF-8)?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Feb 1 '07 #3
ThunderMusic <No************ *************@N oSpAm.comwrote:
it's actually because we are sending mails to hotmail, and because our
application is in utf-8 and hotmail uses ISO-8859-1, so if we send a message
encoded using UTF-8, the displayed message comes out plain ugly in
hotmail...
Does Hotmail *really* only use ISO-8859-1? Eek - how horrible.
So we must find a way to convert things correctly... to give an exemple of
what should be converted... a character like the oe (o and e tied together)
should be converted to ISO-8859-1 oe (o and e separatly) because the "tied
together" version does not exists in 8859-1...

Anyone knows how to do it seemlessly?
Right. At that point you're talking about much more than just normal
encoding - and unfortunately we've reached the limit of my knowledge
there :(

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 1 '07 #4
actually, hotmail supports 4 types of encoding, but not UTF-8 nor UTF-16, so
it's becoming a problem...

Thanks... I'm still searching for informations on the net...

ThunderMusic

"Jon Skeet [C# MVP]" <sk***@pobox.co mwrote in message
news:MP******** *************** *@msnews.micros oft.com...
ThunderMusic <No************ *************@N oSpAm.comwrote:
>it's actually because we are sending mails to hotmail, and because our
application is in utf-8 and hotmail uses ISO-8859-1, so if we send a
message
encoded using UTF-8, the displayed message comes out plain ugly in
hotmail...

Does Hotmail *really* only use ISO-8859-1? Eek - how horrible.
>So we must find a way to convert things correctly... to give an exemple
of
what should be converted... a character like the oe (o and e tied
together)
should be converted to ISO-8859-1 oe (o and e separatly) because the
"tied
together" version does not exists in 8859-1...

Anyone knows how to do it seemlessly?

Right. At that point you're talking about much more than just normal
encoding - and unfortunately we've reached the limit of my knowledge
there :(

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Feb 1 '07 #5

"ThunderMus ic" <No************ *************@N oSpAm.comwrote in message
news:u3******** ******@TK2MSFTN GP02.phx.gbl...
it's actually because we are sending mails to hotmail, and because our
application is in utf-8 and hotmail uses ISO-8859-1, so if we send a
message
encoded using UTF-8, the displayed message comes out plain ugly in
hotmail...

So we must find a way to convert things correctly... to give an exemple of
what should be converted... a character like the oe (o and e tied
together)
should be converted to ISO-8859-1 oe (o and e separatly) because the "tied
together" version does not exists in 8859-1...

Anyone knows how to do it seemlessly?
The discrepancy you are seeing in the way IE behaves is due to windows
drawing a correlation between the OEM codepage 1252 and the ISO-8859-1.
Windows-1252 is character set based on ISO-8859-1 in that all characters
have the same encoding except for characters in the 128-159 range. In this
range ISO-8859-1 has a set of control codes that are almost never used these
days. Windows-1252 borrows this area to squeeze in some extra characters.

When a page coming from source claiming ISO-8859-1 charset uses characters
in this range IE just renders the Windows-1252 characters for them. However
something sticking more strictly to ISO-8859-1 just doesn't know what to do
with them.

This doesn't solve your problem I know. If what you say is true then
hotmail is unable to communicate well with all it's possible clients.
That's so shocking it leaves me wondering whether there is something else
wrong.

Can you show some code you are using to generate the email?

Feb 2 '07 #6
If what you say is true then
hotmail is unable to communicate well with all it's possible clients.
That's so shocking it leaves me wondering whether there is something else
wrong.
I strongly-strongly doubt that hotmail is unable to handle UTF-8
Can you show some code you are using to generate the email?
Agree, most likely the probem is here :-)
From experience I know that the chances that I discov a bug in a compiler are
slim (happened two times only). So before blaming something on the compiler,
I check my code 30 times!

This is one of those. I am so sure that hotmail can handle utf-8, that I
would check my code 30 times :-)
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Feb 2 '07 #7

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

Similar topics

48
4640
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at once) * regular expression search & replace. Normally my documents are encoded with the ISO setting. Recently I was writing an XHTML document. After changing the encoding to UTF-8 I used the
43
3789
by: Vladimir | last post by:
Method UnicodeEncoding.GetMaxByteCount(charCount) returns charCount * 2. Method UTF8Encoding.GetMaxByteCount(charCount) returns charCount * 4. But why that? Look: /* Each Unicode character in a string is defined by a Unicode scalar value, also called ...
10
687
by: Christopher H. Laco | last post by:
Long story longer. I need to get web user input into a backend system that a) only grocks single byte encoding, b) expectes the data transer to be 1 bytes = 1 character, and c) uses the HP Roman-6 codepage system wide. As much as it sounds good, UTF/Unicode encoding is not an option, nor is changing the codepage. Tackling the first is easy via Encoding.Default.GetBytes and shoving it over the network. However, Encoding.Default is the...
5
28321
by: DbNetLink | last post by:
I am trying to convert some Japanese text encoded as Shift-JIS/ISO-2022-JP to UTF-8 so I can store all data in my database with a common encoding. My problem is the encoding conversion code works for Japanese characters encoded as "iso-2022-jp" but does not for "shift-jis" What looked straight forward is proving less so, my test code looks like this: <%@ Page Language="C#"%>
9
6162
by: Andy | last post by:
I am trying to write a for loop that will print all the ISO-Latin characters to a database. However: I am not sure exactly how to go about printing the ISO-Latin character set. Would anyone be able to give me some pointers? I think I have to use Encoding eISOLatin = Encoding.GetEncoding(28591); but after this: I am a bit lost. Thanks Andy
9
23710
by: Mark | last post by:
I've run a few simple tests looking at how query string encoding/decoding gets handled in asp.net, and it seems like the situation is even messier than it was in asp... Can't say I think much of the "improvements", but maybe someone here can point me in the right direction... First, it looks like asp.net will automatically read and recognize query strings encoded in utf8 and 16-bit unicode, only the latter is some mutant, non-standard...
5
2577
by: Michiel | last post by:
problem: pasting characters from MSWord into wysiwyg editor (tinyMCE) When we paste text from Word (i.e. MSWindows) to the browser, and in the text is any special character, like smart quotes, but also accented letters, they show up incorrectly. What we see is e.g. ============= turtle species are Â"endangeredÂ" or Â"critically endangeredÂ"
0
1341
by: yuvalbra | last post by:
Hello , I work with asp and send email by cdonts and want to get in in 1255 ISO-Logical encoding every email i got the numbers shows backwords , i need to goto to encoding and replace to ISO-Logical 1255 how to do it right ?
4
4353
by: kettle | last post by:
Hi, I am rather new to python, and am currently struggling with some encoding issues. I have some utf-8-encoded text which I need to encode as iso-2022-jp before sending it out to the world. I am using python's encode functions: -- var = var.encode("iso-2022-jp", "replace") print var --
8
2618
by: lisa1987i | last post by:
I am really having trouble with encoding characters. The application I am creating i based on a NNTP component from Smilla smilla.ru My propblem is when I read a string which contain special characters and the character is set to utf-8. It works fine with iso-8859-1 strings (I think) The problem occurs whene case below is Q, encoding is set to utf-8, s= "=?Utf-8?Q?M=C3=A1scara_WindowsForm?="
0
9456
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9873
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...
0
8713
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 project—planning, coding, testing, and deployment—without 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
7248
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
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.