Click here to Skip to main content
15,899,935 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Eureka! regex matching with stored procedures Pin
honey the codewitch30-Oct-21 15:37
mvahoney the codewitch30-Oct-21 15:37 
GeneralSunshine, something that simple could never work. Pin
Cp-Coder30-Oct-21 6:01
Cp-Coder30-Oct-21 6:01 
GeneralRe: Sunshine, something that simple could never work. Pin
Marc Clifton30-Oct-21 11:54
mvaMarc Clifton30-Oct-21 11:54 
GeneralRe: Sunshine, something that simple could never work. Pin
Cp-Coder31-Oct-21 2:26
Cp-Coder31-Oct-21 2:26 
GeneralRe: Sunshine, something that simple could never work. Pin
GuyThiebaut30-Oct-21 23:37
professionalGuyThiebaut30-Oct-21 23:37 
GeneralRe: Sunshine, something that simple could never work. Pin
Cp-Coder31-Oct-21 2:30
Cp-Coder31-Oct-21 2:30 
GeneralRe: Sunshine, something that simple could never work. Pin
GuyThiebaut31-Oct-21 2:43
professionalGuyThiebaut31-Oct-21 2:43 
RantIf you can't match UTF32 codepoints, you don't support unicode! Pin
honey the codewitch30-Oct-21 6:01
mvahoney the codewitch30-Oct-21 6:01 
*sigh* - (half serious here) what even is the point of UTF16? You still have the possibility of encountering surrogate characters, which means if you want to support unicode streams you have to handle that possibility.

MSSQL supports UTF16, but not UTF32

Consequently, here's me fetching the next character of an NVARCHAR(x) or NTEXT stream, with UTF32 support. Forgive the grotty code, as there is no unsigned data types and no bit shifts, etc

SQL
DECLARE @valueEnd INT = DATALENGTH(@value)/2+1
DECLARE @index INT = 1
DECLARE @ch BIGINT
DECLARE @tch BIGINT
...
SET @ch = UNICODE(SUBSTRING(@value,@index,1))
SET @tch = @ch - 0xd800
IF @tch < 0 SET @tch = @tch + 2147483648
IF @tch < 2048
BEGIN
	SET @ch = @ch * 1024
	SET @index = @index + 1
	IF @index >= @valueEnd RETURN -1 -- error
	SET @ch = @ch + UNICODE(SUBSTRING(@value,@index,1)) - 0x35fdc00
END


This is hateful and slow. I haven't even tested it yet. I know it doesn't gracefully handle any and all invalid unicode streams but to make it do that is even worse. To heck with this.

Why UTF16 with no functions to convert a surrogate pair to UTF32? it's ridic.

Someone asked me the other day why I don't like Microsoft SQL Server. Here's reason #1359

Bad MSSQL! BAD!
Real programmers use butterflies

GeneralRe: If you can't match UTF32 codepoints, you don't support unicode! Pin
User 1537592230-Oct-21 6:39
User 1537592230-Oct-21 6:39 
GeneralRe: If you can't match UTF32 codepoints, you don't support unicode! Pin
honey the codewitch30-Oct-21 6:59
mvahoney the codewitch30-Oct-21 6:59 
GeneralRe: If you can't match UTF32 codepoints, you don't support unicode! Pin
Dan Neely1-Nov-21 3:02
Dan Neely1-Nov-21 3:02 
RantAargs!!!!!! Pin
David O'Neil29-Oct-21 14:22
professionalDavid O'Neil29-Oct-21 14:22 
AnswerRe: Aargs!!!!!! Pin
Randor 29-Oct-21 15:18
professional Randor 29-Oct-21 15:18 
GeneralRe: Aargs!!!!!! Pin
David O'Neil29-Oct-21 15:31
professionalDavid O'Neil29-Oct-21 15:31 
GeneralRe: Aargs!!!!!! Pin
David O'Neil29-Oct-21 15:33
professionalDavid O'Neil29-Oct-21 15:33 
GeneralRe: Aargs!!!!!! Pin
CodeWraith29-Oct-21 17:50
CodeWraith29-Oct-21 17:50 
GeneralRe: Aargs!!!!!! Pin
Sander Rossel30-Oct-21 3:34
professionalSander Rossel30-Oct-21 3:34 
GeneralRe: Aargs!!!!!! Pin
David O'Neil30-Oct-21 4:44
professionalDavid O'Neil30-Oct-21 4:44 
Newsjobs-- Pin
Kent Sharkey29-Oct-21 11:54
staffKent Sharkey29-Oct-21 11:54 
GeneralRe: jobs-- Pin
charlieg29-Oct-21 12:33
charlieg29-Oct-21 12:33 
QuestionRe: jobs-- Pin
Eddy Vluggen29-Oct-21 13:20
professionalEddy Vluggen29-Oct-21 13:20 
GeneralRe: jobs-- Pin
phil.o30-Oct-21 1:39
professionalphil.o30-Oct-21 1:39 
GeneralRe: jobs-- Pin
Nelek30-Oct-21 9:06
protectorNelek30-Oct-21 9:06 
GeneralRe: jobs-- Pin
Southmountain30-Oct-21 4:46
Southmountain30-Oct-21 4:46 
GeneralRe: jobs-- Pin
theoldfool30-Oct-21 4:58
professionaltheoldfool30-Oct-21 4:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   479 votes