Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. TFW Microsoft's own tools don't like to work with their tools

TFW Microsoft's own tools don't like to work with their tools

Scheduled Pinned Locked Moved The Lounge
csharpdatabasevisual-studiotoolshelp
29 Posts 15 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Ravi Bhavnani

    Wow.  I've never seen VS inject non-breaking spaces in text files. :omg: /ravi

    My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

    H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #5

    I'd really like to know why, myself. It's infuriating.

    Real programmers use butterflies

    M 1 Reply Last reply
    0
    • H honey the codewitch

      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

      B Offline
      B Offline
      Brisingr Aerowing
      wrote on last edited by
      #6

      What VS Version?

      What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

      H 1 Reply Last reply
      0
      • H honey the codewitch

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #7

        Hi, It sounds like you are using VSCode. It also sounds like you are accidentally holding down the shift key when hitting your spacebar. Shift-space in VSCode will produce a non-breaking space[^]. Best Wishes, -David Delaune

        H 1 Reply Last reply
        0
        • L Lost User

          Hi, It sounds like you are using VSCode. It also sounds like you are accidentally holding down the shift key when hitting your spacebar. Shift-space in VSCode will produce a non-breaking space[^]. Best Wishes, -David Delaune

          H Offline
          H Offline
          honey the codewitch
          wrote on last edited by
          #8

          I'm not using VS code, and not hitting SHIFT-space. This is happening when i copy (or paste?) from one editor window to another.

          Real programmers use butterflies

          L 1 Reply Last reply
          0
          • B Brisingr Aerowing

            What VS Version?

            What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

            H Offline
            H Offline
            honey the codewitch
            wrote on last edited by
            #9

            2019. It's up to date.

            Real programmers use butterflies

            B 1 Reply Last reply
            0
            • H honey the codewitch

              I'm not using VS code, and not hitting SHIFT-space. This is happening when i copy (or paste?) from one editor window to another.

              Real programmers use butterflies

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #10

              Hmmm, Is it a 0D followed by a 0A? Or just an 0A all by itself? The Visual Studio 2019 editor should produce a \r\n (CRLF). The LF all by itself is really a Unix/Linux thing.

              H 1 Reply Last reply
              0
              • H honey the codewitch

                2019. It's up to date.

                Real programmers use butterflies

                B Offline
                B Offline
                Brisingr Aerowing
                wrote on last edited by
                #11

                I haven't seen this, though I haven't pasted much text.

                What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

                1 Reply Last reply
                0
                • L Lost User

                  Hmmm, Is it a 0D followed by a 0A? Or just an 0A all by itself? The Visual Studio 2019 editor should produce a \r\n (CRLF). The LF all by itself is really a Unix/Linux thing.

                  H Offline
                  H Offline
                  honey the codewitch
                  wrote on last edited by
                  #12

                  No, that's codes 13 and 10. This is code 160. The issue is not line breaks. It's inserting non-breaking spaces.   in html. or &#A0 (not 0A) Unrelated: Adding, I don't know why apps have so many problems with line breaks.

                  switch(currentChar) {
                  case '\n':
                  ++line;
                  column = 1;
                  break;
                  case '\r':
                  column = 1;
                  break;
                  case '\t':
                  column = (((column-1)/tabWidth)+1)*tabWidth+1; // i think. I'd have to look at some of my ref code
                  break;
                  default:
                  if(currentChar>31) ++column;
                  break;

                  }

                  That handles linebreaks regardless of platform and some other basic whitespace besides. easy peasy.

                  Real programmers use butterflies

                  L 1 Reply Last reply
                  0
                  • H honey the codewitch

                    No, that's codes 13 and 10. This is code 160. The issue is not line breaks. It's inserting non-breaking spaces.   in html. or &#A0 (not 0A) Unrelated: Adding, I don't know why apps have so many problems with line breaks.

                    switch(currentChar) {
                    case '\n':
                    ++line;
                    column = 1;
                    break;
                    case '\r':
                    column = 1;
                    break;
                    case '\t':
                    column = (((column-1)/tabWidth)+1)*tabWidth+1; // i think. I'd have to look at some of my ref code
                    break;
                    default:
                    if(currentChar>31) ++column;
                    break;

                    }

                    That handles linebreaks regardless of platform and some other basic whitespace besides. easy peasy.

                    Real programmers use butterflies

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #13

                    honey the codewitch wrote:

                    I don't know why apps have so many problems with line breaks

                    There was some politics involved from the very top. (As to why notepad and other Windows text editors didn't support files with LF newlines).

                    1 Reply Last reply
                    0
                    • H honey the codewitch

                      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

                      J Offline
                      J Offline
                      Jorgen Andersson
                      wrote on last edited by
                      #14

                      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

                      H 1 Reply Last reply
                      0
                      • H honey the codewitch

                        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

                        K Offline
                        K Offline
                        Kelly Herald
                        wrote on last edited by
                        #15

                        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

                        H 1 Reply Last reply
                        0
                        • H honey the codewitch

                          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

                          B Offline
                          B Offline
                          BernardIE5317
                          wrote on last edited by
                          #16

                          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

                          H 1 Reply Last reply
                          0
                          • B BernardIE5317

                            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

                            H Offline
                            H Offline
                            honey the codewitch
                            wrote on last edited by
                            #17

                            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

                            1 Reply Last reply
                            0
                            • K Kelly Herald

                              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

                              H Offline
                              H Offline
                              honey the codewitch
                              wrote on last edited by
                              #18

                              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

                              1 Reply Last reply
                              0
                              • J Jorgen Andersson

                                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

                                H Offline
                                H Offline
                                honey the codewitch
                                wrote on last edited by
                                #19

                                I've only noticed it around my variables. Maybe because that's when SQL yells at me.

                                Real programmers use butterflies

                                J 1 Reply Last reply
                                0
                                • H honey the codewitch

                                  I've only noticed it around my variables. Maybe because that's when SQL yells at me.

                                  Real programmers use butterflies

                                  J Offline
                                  J Offline
                                  Jorgen Andersson
                                  wrote on last edited by
                                  #20

                                  What types are those variables?

                                  Wrong is evil and must be defeated. - Jeff Ello

                                  H 1 Reply Last reply
                                  0
                                  • J Jorgen Andersson

                                    What types are those variables?

                                    Wrong is evil and must be defeated. - Jeff Ello

                                    H Offline
                                    H Offline
                                    honey the codewitch
                                    wrote on last edited by
                                    #21

                                    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

                                    1 Reply Last reply
                                    0
                                    • H honey the codewitch

                                      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

                                      L Offline
                                      L Offline
                                      Luc Pattyn
                                      wrote on last edited by
                                      #22

                                      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...

                                      E 1 Reply Last reply
                                      0
                                      • L Luc Pattyn

                                        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...

                                        E Offline
                                        E Offline
                                        englebart
                                        wrote on last edited by
                                        #23

                                        Based on this, try renaming files to .template.txt? Also, if there is Paste -> special, try pasting plain text

                                        1 Reply Last reply
                                        0
                                        • H honey the codewitch

                                          I'd really like to know why, myself. It's infuriating.

                                          Real programmers use butterflies

                                          M Offline
                                          M Offline
                                          markchagers
                                          wrote on last edited by
                                          #24

                                          Are you sure it isn't something introduced by the clipboard itself? not VS?

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups