Solved

International Character Sets URL Encoding MS SQL

Posted on 2014-01-16
3
540 Views
Last Modified: 2014-03-13
I am trying to URL Encode a list of names from inside MS SQL using a function I found at the following Url : http://sqlblog.com/blogs/peter_debetta/archive/2007/03/09/t-sql-urlencode.aspx

The issue I am coming up against is it does not seem to handle international character sets, like the Ø from Scandinavian languages. I am passing over the data as NVARCHAR, the return character for the Ø seems to be a question mark instead.
0
Comment
Question by:AbeSpain
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Habib Pourfard earned 500 total points
ID: 39785501
it is as a result of the collation in the following line:

IF @c LIKE N'[A-Za-z0-9()''*\-._!~]' COLLATE Latin1_General_BIN ESCAPE N'\' COLLATE Latin1_General_BIN

Open in new window


You can alter function and replace Latin1_General_BIN with scandinavian collation.
0
 

Author Comment

by:AbeSpain
ID: 39785649
That doesn't seem to help, the return string does have the correct character but is not urlencoded.
0
 
LVL 12

Assisted Solution

by:Habib Pourfard
Habib Pourfard earned 500 total points
ID: 39785751
I think  in addition to changing of collation, if you add Scandinavian characters to the end of this string (before bracket) it should be working:

IF @c LIKE N'[A-Za-z0-9()''*\-._!~ØØØØØØ]'
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article I will describe the Backup & Restore 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.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

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

24 Experts available now in Live!

Get 1:1 Help Now