TFW Microsoft's own tools don't like to work with their tools
-
So I'm using visual studio and it seems to randomly replace spaces in my text with character 160 when i do clipboard operations with it. Not all the time, mind you, but I haven't figured out exactly what happens to make it do that yet. Normally, I wouldn't care. Whitespace is whitespace, and it's all unicode right? Well no. SQL's parser does not accept character 160 as whitespace. Worse, it gives you weird errors around it. For example:
SET @cc = CASE @ch WHEN 9 THEN (((@cc - 1) / @tabWidth) + 1) * @tabWidth + 1 WHEN 10 THEN 1 WHEN 13 THEN 1 ELSE @cc END
This said I needed to declare the variable '@ch' The real issue was that variable was surrounded by char# 160's :mad: Do they not dogfood their tools? How am I the first person to run into this?
Real programmers use butterflies
Ah yes. ASCII 160 which equates to HTML's non-breaking space, i.e.
. As a SQL developer I'm constantly having to fix data from people copying from a web page and pasting into Excel / Word and then copying from there and inserting the values into a database table.Kelly Herald Software Developer
-
So I'm using visual studio and it seems to randomly replace spaces in my text with character 160 when i do clipboard operations with it. Not all the time, mind you, but I haven't figured out exactly what happens to make it do that yet. Normally, I wouldn't care. Whitespace is whitespace, and it's all unicode right? Well no. SQL's parser does not accept character 160 as whitespace. Worse, it gives you weird errors around it. For example:
SET @cc = CASE @ch WHEN 9 THEN (((@cc - 1) / @tabWidth) + 1) * @tabWidth + 1 WHEN 10 THEN 1 WHEN 13 THEN 1 ELSE @cc END
This said I needed to declare the variable '@ch' The real issue was that variable was surrounded by char# 160's :mad: Do they not dogfood their tools? How am I the first person to run into this?
Real programmers use butterflies
Greetings Have you submitted a bug report preferably w/ reproducible steps or even the entire project or a GIF of the recorded screen They recommended ScreenToGIF to myself - Kind Regards
-
Greetings Have you submitted a bug report preferably w/ reproducible steps or even the entire project or a GIF of the recorded screen They recommended ScreenToGIF to myself - Kind Regards
I haven't. Honestly i've got a lot going on right now and I don't really want to take the time to submit to the black hole or "/dev/null" that is Microsoft's bug tracking. If they were responsive in the past, I may make it more of a priority but they haven't been and I won't.
Real programmers use butterflies
-
Ah yes. ASCII 160 which equates to HTML's non-breaking space, i.e.
. As a SQL developer I'm constantly having to fix data from people copying from a web page and pasting into Excel / Word and then copying from there and inserting the values into a database table.Kelly Herald Software Developer
The thing is microsoft is putting this stuff in my content that's coming from plain text files (well .template files, but it's not like there's a VS handler for them)
Real programmers use butterflies
-
Sounds like there is some kind of formatting happening. Does it happen with dates or numbers?
Wrong is evil and must be defeated. - Jeff Ello
I've only noticed it around my variables. Maybe because that's when SQL yells at me.
Real programmers use butterflies
-
I've only noticed it around my variables. Maybe because that's when SQL yells at me.
Real programmers use butterflies
What types are those variables?
Wrong is evil and must be defeated. - Jeff Ello
-
What types are those variables?
Wrong is evil and must be defeated. - Jeff Ello
They're just basic SQL procedure variables. DECLARE (at)ch INT = -1 That shouldn't say (at) but this forum wants to link a poster named ch when i type it properly. ... It has nothing to do with the language and everything to do with VS replacing spaces with non-breaking spaces.
Real programmers use butterflies
-
So I'm using visual studio and it seems to randomly replace spaces in my text with character 160 when i do clipboard operations with it. Not all the time, mind you, but I haven't figured out exactly what happens to make it do that yet. Normally, I wouldn't care. Whitespace is whitespace, and it's all unicode right? Well no. SQL's parser does not accept character 160 as whitespace. Worse, it gives you weird errors around it. For example:
SET @cc = CASE @ch WHEN 9 THEN (((@cc - 1) / @tabWidth) + 1) * @tabWidth + 1 WHEN 10 THEN 1 WHEN 13 THEN 1 ELSE @cc END
This said I needed to declare the variable '@ch' The real issue was that variable was surrounded by char# 160's :mad: Do they not dogfood their tools? How am I the first person to run into this?
Real programmers use butterflies
It seems to be a feature, not a bug: MS rich text editors prefer non-breaking spaces to "maintain the correct spacing format". I never ran into this specific problem, however I sometimes use a little tool to delete any non-plain-text representation of data present on the clipboard, e.g. when the target app does not provide a "paste as plain text" option. :)
Luc Pattyn [My Articles] If you can't find it on YouTube try TikTok...
-
It seems to be a feature, not a bug: MS rich text editors prefer non-breaking spaces to "maintain the correct spacing format". I never ran into this specific problem, however I sometimes use a little tool to delete any non-plain-text representation of data present on the clipboard, e.g. when the target app does not provide a "paste as plain text" option. :)
Luc Pattyn [My Articles] If you can't find it on YouTube try TikTok...
-
I'd really like to know why, myself. It's infuriating.
Real programmers use butterflies
Are you sure it isn't something introduced by the clipboard itself? not VS?
-
So I'm using visual studio and it seems to randomly replace spaces in my text with character 160 when i do clipboard operations with it. Not all the time, mind you, but I haven't figured out exactly what happens to make it do that yet. Normally, I wouldn't care. Whitespace is whitespace, and it's all unicode right? Well no. SQL's parser does not accept character 160 as whitespace. Worse, it gives you weird errors around it. For example:
SET @cc = CASE @ch WHEN 9 THEN (((@cc - 1) / @tabWidth) + 1) * @tabWidth + 1 WHEN 10 THEN 1 WHEN 13 THEN 1 ELSE @cc END
This said I needed to declare the variable '@ch' The real issue was that variable was surrounded by char# 160's :mad: Do they not dogfood their tools? How am I the first person to run into this?
Real programmers use butterflies
Never seen that happen myself, and I use VS extensively. What type of file are you editing (.htm, .aspx, whatever)?
Paul Sanders http://www.alpinesoft.co.uk
-
I just noticed it today. It's weird, and it isn't the SQL editor directly. I have these ".template" files, like "CompiledTokenizer.sql.template" that generates sql output, but the template file itself uses ASP-like syntax with <%,<%= and %> In this template I do a bunch of crazy things by walking state machines to render thousands of lines of stored proc code. But when I'm pasting around that .template file is when the 160s crop up. Even if I paste into it from the SQL editor and then copy out of it, I'll get 160s. The .template file isn't a recognized format by visual studio. I tried naming it .asp and even .aspx to give me so highlighting, but that only did the *client* code, and if anything I want the server code highlighted, so I just named it .template and editing it as a POTF instead of anything fancy. I don't know if that has anything to do with it. I'm grasping.
Real programmers use butterflies
Try opening the files in Visual Studio's binary editor, and see if there's a UNICODE byte order mark at the beginning. If there is (marking the file as UTF-8, for example), that could be influencing the behavior of the editor.
Software Zen:
delete this;
-
So I'm using visual studio and it seems to randomly replace spaces in my text with character 160 when i do clipboard operations with it. Not all the time, mind you, but I haven't figured out exactly what happens to make it do that yet. Normally, I wouldn't care. Whitespace is whitespace, and it's all unicode right? Well no. SQL's parser does not accept character 160 as whitespace. Worse, it gives you weird errors around it. For example:
SET @cc = CASE @ch WHEN 9 THEN (((@cc - 1) / @tabWidth) + 1) * @tabWidth + 1 WHEN 10 THEN 1 WHEN 13 THEN 1 ELSE @cc END
This said I needed to declare the variable '@ch' The real issue was that variable was surrounded by char# 160's :mad: Do they not dogfood their tools? How am I the first person to run into this?
Real programmers use butterflies
I seldom copy and paste code but I tried to copy and paste the entire code for a form Don't ask WHY I am a novice I am using VS 2019 V 16.7.5 VB.Net project A long time ago I would just use MS Notepad and would always get errors with my simple SQLite statements So I would rewrite them line for line and character then they would execute fine OK so this does not answer your question it is way above my pay grade ha ha TODAY I use Sublime Text 2 I paste my copy of code into Sublime and move it to a new project where I am trying to fix an unrelated issue. The code was saved while it was living in Sublime so open the file and copy and paste into VS No Issues Someday I will learn how to move the Form and all the Controls
-
So I'm using visual studio and it seems to randomly replace spaces in my text with character 160 when i do clipboard operations with it. Not all the time, mind you, but I haven't figured out exactly what happens to make it do that yet. Normally, I wouldn't care. Whitespace is whitespace, and it's all unicode right? Well no. SQL's parser does not accept character 160 as whitespace. Worse, it gives you weird errors around it. For example:
SET @cc = CASE @ch WHEN 9 THEN (((@cc - 1) / @tabWidth) + 1) * @tabWidth + 1 WHEN 10 THEN 1 WHEN 13 THEN 1 ELSE @cc END
This said I needed to declare the variable '@ch' The real issue was that variable was surrounded by char# 160's :mad: Do they not dogfood their tools? How am I the first person to run into this?
Real programmers use butterflies
Hmmm, I wonder if this explains strange problems we've seen from time to time where we paste code into MS SQL Server Mgt Studio's editor for a query and it looks fine to the eye, but gives a syntax error, and then when you retype it it all works. Next time I see it, I'll dig deeper.
-
Hmmm, I wonder if this explains strange problems we've seen from time to time where we paste code into MS SQL Server Mgt Studio's editor for a query and it looks fine to the eye, but gives a syntax error, and then when you retype it it all works. Next time I see it, I'll dig deeper.
It sounds like the same problem. I feel bad for you, but good that I'm not the only one. :laugh:
Real programmers use butterflies