473,737 Members | 5,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

iso-8859-1 and UTF-8

hi,

I have this ASP application which is taking text from an NVARCHAR and NTEXT
columns and outputs them in the response.

The problem has to do with encoding.. basically the text appears to be UTF-8
(i'm not sure about this, but its definitely not iso-8859-1) but i need it
to be outputted as iso-8859-1.

Why I need to do this? Because the asp application includes files which have
been saved in iso-8859-1 encoding and unfortunately i cannot just change
their encoding as these files are used everywhere on the website and
therefore the consequences could be disastrous.

If i were to set Response.CharSe t = "utf-8" the text i'm taking from the
database appears correctly, but then the include files will not :(

the inverse will happen if i were to set response.CharSe t = "iso-8859-1" :(

Seems like I'm in deep trouble. How can i fix this? :(

thanks
Feb 24 '06 #1
3 9635
I'll assume that the DB fields are NVARCHAR for a reason. Hence ISO-8859-1
doesn't cover what you need because NVARCHAR is able to represent a wider
range of characters than ISO-8859-1.

So you need to send your pages as UTF-8.

Are the 'Include files' ASP pages that need processing or static content
that simply needs to be sent to the response?

What would you say the was the frequency of characters outside of the 7-bit
ASCII code range in the include files?

Feb 24 '06 #2
hi,

thanks for your reply

the fields are nvarchar or ntext because they store text in different
languages. Mainly European, but wanted it to be open for any future
expansion.

I must admit that encoding is a subject that i know very little about. :(
The fact is however, that this system I'm speaking about is an old one, i.e.
i had developed it a long time ago but it is working perfectly on the live
servers. Now i needed to make an update (minor changes) to it but all of a
sudden my test server is acting as i described below. :( and i'm not risking
to upload the changes on the live... :(

The include files are static design files (html) which contains menus and
side bars etc..

The problem lies in the non-english characters, i.e. the French, Spanish,
German languages have characters which are not found in the ASCII range.
Iso-8859-1 seems to have these though since the include files are displayed
correctly..

Could this be an issue of SQL Server?

From your answer I understood that the problem most probably is that SQL
Server is storing the text as utf-8. Maybe the live server has different
collation then the test server? But before doing the updates I first backed
up the live database and restored it on a local test server, so collation
should have remained the same, or no?

"Anthony Jones" <An*@yadayadaya da.com> wrote in message
news:ea******** ******@tk2msftn gp13.phx.gbl...
I'll assume that the DB fields are NVARCHAR for a reason. Hence
ISO-8859-1
doesn't cover what you need because NVARCHAR is able to represent a wider
range of characters than ISO-8859-1.

So you need to send your pages as UTF-8.

Are the 'Include files' ASP pages that need processing or static content
that simply needs to be sent to the response?

What would you say the was the frequency of characters outside of the
7-bit
ASCII code range in the include files?

Feb 25 '06 #3
>Could this be an issue of SQL Server?
From your answer I understood that the problem most probably is that SQL
Server is storing the text as utf-8. Maybe the live server has different
collation then the test server? But before doing the updates I first backed
up the live database and restored it on a local test server, so collation
should have remained the same, or no?


This is not a SQL Server problem. NVARCHAR stores text as unicode 2-btye
characters. This is the same character format used natively by the script
engines used by ASP.

Ultimately any string you retrieve from any database stored in a field of
any data type will always end up being a unicode string.

When you subsequently send that string to the client with Response.Write the
response object will convert the string to the appropriate charset as
specified on the Session.CodePag e property.

Your problem is that static content in a page must already be in the
appropriate code page since it will be sent to the client as-is.

You will need to change save each page in UTF-8 format.

Place this at the top each:-

<%@ CodePage=65001 %>

and ensure you inform the client it is recieve UTF-8 with

Response.CharSe t = "UTF-8"

Anthony.

Feb 25 '06 #4

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

Similar topics

13
476
by: jrefactors | last post by:
When people say C programming language, they mean ISO C89? The latest C is ISO C99, but I heard this is not commonly used. What's the differences between ISO C89 and ISO C99? Please advise. Thanks
22
1930
by: Sensei | last post by:
Hi! I'm looking for useful libraries that are strictly ISO C. Any kind of library, from lists, stacks, to trees, searching tools, sorting tools... really *any* kind. Do you have any idea? :) -- Sensei <senseiwa@mac.com>
22
4058
by: pemo | last post by:
ISO C does not allow extra ';' outside of a function int n;; int main(void) { .... } Anyone care to enlighten me as to why ISO C does not allow this, but
2
2037
by: John Daly | last post by:
Hope this is the right place to post this. I recently downloaded iso disc imsges, however my new pc did not come with burning software, and i can not find my old discs. I tried to use the Burning Wizzard built into Windows XP but it jsut copied the ISO file as is. Now for some assumptions on my part. I am assuming an .iso file is similar in nature to a zip file in that the directory strucutre and the files are packed into 1 larger file....
9
2647
by: Alok | last post by:
Hi, I want to purchase the ISO C++ standard ISO/IEC 14882:2003 specification for reference. The ANSI store sells the PDF or CD-ROM of the document for $30 http://webstore.ansi.org/ansidocstore/product.asp?sku=INCITS%2FISO%2FIEC+14882-2003, but the ISO store sells the seemingly same document for CHF 352 ( or over $281.82 http://www.google.com/search?q=352+chf+in+usd )...
52
1565
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places? ----------------------------------------------------------------------- When formatting money for example, to format 6.57634 to 6.58, 6.5 to 6.50, and 6 to 6.00? Rounding of x.xx5 is uncertain, as such numbers are not represented exactly.
1
2667
by: danikar | last post by:
Is there a way to open a file that is inside of an ISO in python? Say I have an ISO file, danikars.iso and on the iso there is a file called information.txt I want to be able to do something like this. iso_h = openiso("danikars.iso") file_h = iso_h.extract("information.txt")
11
2227
by: ManicQin | last post by:
Hi, I was about to buy the Standard but then I found this link http://www.usatlas.bnl.gov/~dladams/cpp/INCITS+ISO+IEC+14882-2003.pdf Hmmmm... ... The link seems legit so ... what gives? Thanks...
1
1963
by: scotter86 | last post by:
Hi everyone, I'm trying to "burn","mount" what ever you want to call it, an .iso file to a hard disk partition. What I'm trying to do is get this iso on a partition and boot it much like I would a cd. I saw a couple examples where it was able to work using a boot loader, and just pointing to the iso, but i want to do it with out using a boot loader. The iso is just a linux live cd, but I was curious weather or not this is actually possible. ...
10
4335
by: tvnaidu | last post by:
I am using Three pthread functions below, I got ISO error, then I declared int variable called val123, then I assigned, but still I am getting error, any idea?. also I included pthread.h. compiling in Linux with GCC. pthread_cond_signal(&(receiverConf->receive_q_cond)); pthread_cond_destroy(&(receiverConf->receive_q_cond)); pthread_mutex_destroy(&(receiverConf->receive_q_lock)); Main.cpp:545: ISO C++ forbids declaration of ` ...
0
8968
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
8786
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
9470
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...
0
9334
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...
1
9258
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
9207
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
4569
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...
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2192
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.