Solved

£ lost from text in SQL database / VB script site

Posted on 2011-09-10
6
274 Views
Last Modified: 2012-05-12
Hi All,

I have a textarea that contains booking notes. Sometimes it may contain £ characters - e.g. "Customer paid £100 deposit".

When I save the contents of the textarea to the database the £ characters are lost, and I can't figure out why.

The charset of the page is utf-8, and the vbscript codepage is set to 65001.

Does anyone have any idea why this could be happening? Any further information needed please ask.

Thanks,

Dan
0
Comment
Question by:stressfreewebs
6 Comments
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 36516318
0
 

Author Comment

by:stressfreewebs
ID: 36516350
Hi Sammy,

I've used format currency before, but only on numeric data. This is text data, so I don't understand how it applies here?

For example, take the string "Discussed discount with custmer - offerred £20 off" - if I saved that, the £ symbol would be lost, but I can't use formatcurrency with that string as it would error, and in any case would not return the result desired if it did work.

Or am I looking at the wrong part of that article?

Thanks for your help,

Dan
0
 
LVL 12

Accepted Solution

by:
Wouter Boevink earned 500 total points
ID: 36516393
I'm not sure but maybe it gets lost in the database, what type of field are you using varchar, text or nvarchar, ntext.
The "N" in NVARCHAR means uNicode,  but I don't now if the pound sign is a standard or an unicode character.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 11

Expert Comment

by:tobzzz
ID: 36516677
Does your page contain <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> in the <head> tags?

Is the page saved as UTF-8 format? (check by opening and saving-as in something simple like Windows Notepad).

When you say lost, do you mean it's changing it to something else or literally disappearing?

/ Tobzzz
0
 

Author Comment

by:stressfreewebs
ID: 36516743
Hi tobzzz,

Yes it is in utf-8, and the symbol is literally disappearing...I'm going to look into the data type on the server mentioned above but can't do it until wed next week...will update if that's the solution :)

Thanks everyone, dan
0
 

Author Closing Comment

by:stressfreewebs
ID: 36516758
I managed to get on sooner than next week - and yipee it worked!

I never knew that...it now makes sense why I've had similar problems before with various symbols in that field type!

Thanks everyone, great :)
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now