473,388 Members | 1,391 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,388 software developers and data experts.

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.dtd">
<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 2561
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.dtd">
<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.com> 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.dtd">


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*****@physics.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
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...
44
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...
19
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
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...
8
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,...
4
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,...
7
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
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"...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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 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.