encoding problem with spanish special characters

638 views
Skip to first unread message

efrank

unread,
Nov 21, 2009, 1:02:57 AM11/21/09
to XMPie Interest Group
Our projects are geared towards spanish speaking recipients and hence
we have a lot of characters that pose a problem for the encoding. I
have a form in a referral page where recipients are to fill out name
and last name. If those contain special characters, these are written
wrongly to the database. I also have an insert expression that
concatenates name+last name+random number. The resulting string is
used in URL's and when they contain special character, an error is
displayed.
For example, a recipient named José Peñalver is to the database as
Jos? Pe?alver and insert expression looks like this Jos?.Pe?alver.
4321, which in turn brings up an error in uProduce that looks like
this:
One or more of the recipients (Jos?.Pe?alver.4321) do not exist.
Has someone dealt with this situation before? What is the correct
approach to solve this?

couch

unread,
Nov 21, 2009, 5:23:45 AM11/21/09
to XMPie Interest Group
There are two main issues here:

1) your database should be set to take unicode text - so if the data
type is varchar in SQL, change it to nvarchar - this should then
permit storing of accented and even double-byte characters

2) the url. many older format browsers don't support non ascii
characters in the url. All of the latest versions do, so depending on
the browser version this should be resolved with item # 1.

There is also a third issue (less likely if you are already doing web
pages with accented characters), which is the encoding in the email or
web page where you are displaying your personalised url link. If the
encoding of that html page or email is incorrect, the link will be
invalid.

efrank

unread,
Nov 21, 2009, 8:17:38 AM11/21/09
to XMPie Interest Group
Thanks couch

my database has its fields set to nvarchar. So that is not the cause.
I believe that the cause is more on the aspx file side. I had to set
the charset to iso-8859-1 instead of utf-8, because because text in
the html was loosing the special characters. Could this be it? I'll
try to run a test.

efrank

unread,
Nov 22, 2009, 12:52:54 PM11/22/09
to XMPie Interest Group
We had a an iso-8859-1 utf-8 mismatch in the filles. Back to utf-8 and
everything is ok now.
The charset declarations in the head were in utf-8, then we pasted in
the body section of the page. It was copied from the code the designer
came up with on an opensource tool different from Dreamweaver. The
body section contained a charset declaration set to iso-8859-1 that we
had not seen. My fault, I was too careless with code done by a third
party.

Timothy Perrett

unread,
Nov 22, 2009, 6:16:37 PM11/22/09
to xmpie...@googlegroups.com
The declerations in the HTML regarding content encoding actually do
nothing - they are a mere hint to the browser (and to a lesser degree;
the runtime also) about how to handle this document.

File encoding is one of those things that trips people up time and
time again in the wider web dev world - don't worry about it; your not
the first person and you certainly won't be the last :-)

Cheers, Tim

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages