Solved

£ lost from text in SQL database / VB script site

Posted on 2011-09-10
6
273 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

20 Experts available now in Live!

Get 1:1 Help Now