Hi,
I have a very common problem. I try to change my encoding from
defaultencoding (UTF-16) to iso-8859-15.
My source:
Encoding encoder = Encoding.GetEncoding("iso-8859-15");
log.logDebug("Encoding is " + encoder.GetEncoder());
byte[] byteArray = new byte[buffer.Length];
byteArray = encoder.GetBytes(buffer);
the logging output:
Encoding is System.Text.Encoding+DefaultEncoder
Does anybody has an idea. I would appreciate it.
Marco 6 1492
Hi Marco,
I'm not too familiar with the Encoder class, but I believe it is created
based on the number of bytes needed to define a character in a certain
Encoding, so any of the 8-bit encodings like "ISO-8859-15" would create an
Encoder of default type.
--
Happy Coding!
Morten Wennevik [C# MVP]
Is there another way to determin the encoding, so that iso-8859-15 is token?
"Morten Wennevik" wrote: Hi Marco,
I'm not too familiar with the Encoder class, but I believe it is created based on the number of bytes needed to define a character in a certain Encoding, so any of the 8-bit encodings like "ISO-8859-15" would create an Encoder of default type.
-- Happy Coding! Morten Wennevik [C# MVP]
Marco,
System.Text.Encoding.GetEncoding(437).GetBytes()
I don't know what thable that 8859 is I thought 1252
Cor
Hi Cor,
tried this already. But it doesn't matter which parameter I pass the method
GetEncoding(), I always become the Default- Encoder.
Some parametervalues I used: "ISO-8859-15", 1252, 437
Marc
"Cor Ligthert" wrote: Marco,
System.Text.Encoding.GetEncoding(437).GetBytes()
I don't know what thable that 8859 is I thought 1252
Cor
What are you trying to accomplish?
On Tue, 22 Mar 2005 05:11:08 -0800, Marco
<Ma***@discussions.microsoft.com> wrote: Hi Cor,
tried this already. But it doesn't matter which parameter I pass the method GetEncoding(), I always become the Default- Encoder.
Some parametervalues I used: "ISO-8859-15", 1252, 437
Marc
"Cor Ligthert" wrote:
Marco,
System.Text.Encoding.GetEncoding(437).GetBytes()
I don't know what thable that 8859 is I thought 1252
Cor
--
Happy Coding!
Morten Wennevik [C# MVP]
Marco <Ma***@discussions.microsoft.com> wrote: I have a very common problem. I try to change my encoding from defaultencoding (UTF-16) to iso-8859-15. My source:
Encoding encoder = Encoding.GetEncoding("iso-8859-15"); log.logDebug("Encoding is " + encoder.GetEncoder()); byte[] byteArray = new byte[buffer.Length]; byteArray = encoder.GetBytes(buffer);
the logging output:
Encoding is System.Text.Encoding+DefaultEncoder
Does anybody has an idea. I would appreciate it.
That's giving the right encoder - it's just implemented by a class
called DefaultEncoder nested inside Encoding.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: lawrence |
last post by:
Validator chokes on my pages now because I started sending an
character encoding header of UTF-8 but the page is full of non UTF-8
characters. Anyway quick way to convert them?
...
|
by: Edward K. Ream |
last post by:
Am I reading pep 277 correctly? On Windows NT/XP, should filenames always
be converted to Unicode using the mbcs encoding? For example,
myFile = unicode(__file__, "mbcs", "strict")
This...
|
by: Paulo da Silva |
last post by:
Hi.
I am using unicode encode method to write some
accented chars to files (%s). Do I need to use
the method "encode" always? Isn't there a general
way to declare the encoding for the whole...
|
by: chandy |
last post by:
Hi,
I have an Html document that declares that it uses the utf-8 character
set. As this document is editable via a web interface I need to make
sure than high-ascii characters that may be...
|
by: xmlguy |
last post by:
This is part of the application that reads XML from file
(that has UTF-8) into an XmlTextReader
XmlTextReader myXmlReader = new XmlTextReader(args);
It then instantiates an object/class...
| |
by: jmgonet |
last post by:
Hello everybody,
I'm having troubles loading a Xml string encoded in UTF-8.
If I try this code:
------------------------------
XmlDocument doc=new XmlDocument();
String s="<?xml...
|
by: pagates |
last post by:
Hello,
I am playing a little with Encoding, and I have what is possibly (forgive
me) a newbie-type question.
I have a function that takes a string and a codepage (based upon the basic
MSDN...
|
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...
|
by: Simon Niederberger |
last post by:
Hi all
I'm having some trouble with UTF8 / ISO-8859-1 encoding using a Webservice
based on PEAR::SOAP_Server. The client essentially sends an XML file as data
(i.e. XML-data wrapped in SOAP-XML...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 ...
| |