473,769 Members | 4,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what's the right encoding?

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Â"
=============

The strangest thing is that on our test server, where we have the same
website running, the problem does *not* occur, but we cannot find any
difference.

The head of our documents is using:

=============== ==
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
=============== ==

In a newer version of our system we use:
=============== ==
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"
xml:lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
=============== ==

But that doesn't change anything. The problem still occurs

Where do these characters come from? How do we prevent this from
happening?

Michiel

Mar 30 '06 #1
5 2578
On 30 Mar 2006, Michiel wrote:
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.
I don't know what "tinyMCE" is - but you need a "Unicode-savvy"
editor when pasting characters from MS Word. If I'm not mistaken,
MS Word encodes characters in UTF-8 or UTF-16.
Try Mozilla's Composer, for example.
The head of our documents is using:
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
This is pointless. Rather make sure that your *webserver*
sends the correct Content-Type *including* charset parameter.
http://www.w3.org/International/O-HTTP-charset.html
http://ppewww.ph.gla.ac.uk/~flavell/...t/ns-burp.html
In a newer version of our system we use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"
xml:lang="en-US">


Why? Because XHTML is "newer"?
XHTML 1.0 *Transitional* is only used by the clueless.
If you use Transitional, you could equally well take HTML 3.2.
Take a look (or two) at
http://ppewww.ph.gla.ac.uk/~flavell/charset/

--
All free men, wherever they may live, are citizens of Denmark.
And therefore, as a free man, I take pride in the words "Jeg er dansker!"

Mar 30 '06 #2
On 30 Mar 2006 07:19:26 -0800, "Michiel" <bl****@gmail.c om> wrote:
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.


Ask Word to change the encoding of the characters to UTF-8, and then
declare that as your character set.

Ian
--
http://sundry.ws/
Mar 30 '06 #3
Michiel wrote:
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Â"
Looks like mislabelled utf-8. Configure your server to label it
correctly.
The head of our documents is using:

=============== ==
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
Real HTTP headers matter. That crap (normally) doesn't.

In a newer version of our system we use:
=============== ==
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">


Newer? That's for legacy stuff. That is to say, stuff that
was marked legacy in 1997/98.

--
Nick Kew
Mar 30 '06 #4
On Thu, 30 Mar 2006, Ian Rastall wrote:
Ask Word to change the encoding of the characters to UTF-8, and then
declare that as your character set.

^^^^^^^^^^^^^

For "character set", read "encoding" (as the subject line correctly
stated it already), specified in XHTML by "encoding", and in HTTP by
the old (and now somewhat misleading) MIME attribute called "charset".

In HTML/XHTML, the "document character set" is *always*
iso-10646/unicode, irrespective of the external character encoding.
There's an important principle at stake.

cheers
Apr 3 '06 #5
On Mon, 3 Apr 2006 17:27:23 +0100, "Alan J. Flavell"
<fl*****@physic s.gla.ac.uk> wrote:
There's an important principle at stake.


I agree. It was just a bit of sloppy writing. I shall go back to
Jukka's page on ... that subject ... and get the terminology correct
yet again.

Ian
--
http://sundry.ws/
Apr 3 '06 #6

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

Similar topics

3
2247
by: F. GEIGER | last post by:
When I start a py2exe-ed application I get the error 'ascii' codec can't encode character u'\xe9' in position 10: ordinal not in range(128) This is how I run py2exe: setup.py py2exe -O1 --packages encodings This is how the .po-file looks like:
44
4281
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there must be many know the answer here. thanks
19
7209
by: Mikolas | last post by:
I was trying to use BinaryReader.PeekChar to "peek" the next byte, that works fine unless the byte value's above 127 .... is there anything I can do abouit it? thnx, mikolas
3
3148
by: GT | last post by:
I have a .NET client that consumes an Axis web service. A change was made recently to the AXIS web service, and ever since then my .NET proxy class has been throwing an InvalidCastException. The proxy class was auto-generated by Visual Studio from WSDL provided by people who provide the Axis service, and I have not modified it (except to add code for a build that includes a SOAP trace). The only difference I see in the messages is that...
8
2007
by: clintonG | last post by:
Every single time neophytes or converts ask about naming and style conventions what are they told by the majority consensus? The answer is "do what you prefer but do so consistently" right? Yes, that's right, that's exactly what is said. People joining a team of developers are also encouraged to cooperate with their peers and adopt what has already been established right? Yes, that's exactly what is encouraged. Teamwork and cooperation...
4
2063
by: mistral | last post by:
Can anyone help to identify what this encryption used in this script? <html> <body> <script type="text/javascript" language="JavaScript"> function decrypt_p(x){ var l=x.length, b=1024, i,j,r, p=0,
7
2616
by: Daniel | last post by:
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document?
0
2701
by: Philluminati | last post by:
I have a Perl SOAP Server which returns this SOAP Message when invoked: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http:// schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/ XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/ encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/...
4
6985
by: Erwin Moller | last post by:
Hi, Background: I am working on a multilanguage project now, so I decided to switch to UTF-8 completely to avoid troubles with unicode character. I hope somebody can review my approach and comment on it. I am working on: Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch11
0
9589
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
9423
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
10212
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9995
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
9863
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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...
0
5304
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
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.