Solved

International Character Sets URL Encoding MS SQL

Posted on 2014-01-16
3
549 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Addition to SQL for dynamic fields 6 36
SQL Server 2012 r2 - Calulations within stored procedure involving temp tables 6 26
MS SQL Delete Query 9 30
Sql server insert 13 26
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 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

10 Experts available now in Live!

Get 1:1 Help Now