Re: Escaping international (unicode) characters in string
- From: "Greg R. Broderick" <usenet200705@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 May 2007 12:01:43 -0500
Erland Sommarskog <esquel@xxxxxxxxxxxxx> wrote in
news:Xns993F9F38ABD05Yazorman@xxxxxxxxx:
Greg R. Broderick (usenet200705@xxxxxxxxxxxxxxxxxxxxx) writes:
I am needing some way, in the SQL Server dialect of SQL, to escape
unicode code points that are embedded within an nvarchar string in a
SQL script, e.g. in Java I can do:
String str = "This is a\u1245 test.";
SELECT @str = 'This is a' + nchar(1245) + ' test'
Note here that 1245 is decimal. If you want to use hex code (which you
normally do with Unicode), you would do:
SELECT @str = 'This is a' + nchar(0x1245) + ' test'
When there are more than one or two non-US-ASCII characters in the string,
this quickly becomes impractically unwieldy, thus my comment in my original
posting:
--- quote ---
I am already aware of the UNISTR() function, and the NCHAR() function, but
those aren't going to work well if there are more than a few international
characters embedded within a string.
--- quote ---
Thanks anyway, though. :-)
--
---------------------------------------------------------------------
Greg R. Broderick usenet200705@xxxxxxxxxxxxxxxxxxxxx
A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
.
- Follow-Ups:
- Re: Escaping international (unicode) characters in string
- From: Erland Sommarskog
- Re: Escaping international (unicode) characters in string
- References:
- Escaping international (unicode) characters in string
- From: Greg R. Broderick
- Re: Escaping international (unicode) characters in string
- From: Erland Sommarskog
- Escaping international (unicode) characters in string
- Prev by Date: Re: sorting table while inserting
- Next by Date: Re: needed: 1 + null = 1
- Previous by thread: Re: Escaping international (unicode) characters in string
- Next by thread: Re: Escaping international (unicode) characters in string
- Index(es):
Relevant Pages
|