Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

International Character Sets URL Encoding MS SQL

Posted on 2014-01-16
3
Medium Priority
?
638 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 2000 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard 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 add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Loops Section Overview

926 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