Solved

International Character Sets URL Encoding MS SQL

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

18 Experts available now in Live!

Get 1:1 Help Now