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. Other Discussions
  3. The Weird and The Wonderful
  4. .NET Framework? What .NET Framework?

.NET Framework? What .NET Framework?

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpdotnetquestion
5 Posts 2 Posters 26 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.
  • E Offline
    E Offline
    Erik Burger
    wrote on last edited by
    #1

    I was rewriting an application when I came across the following snippit: System.Text.UTF8Encoding encoder8 = new System.Text.UTF8Encoding(); System.Text.Decoder utf8Decode = encoder8.GetDecoder(); byte[] todecode_byte8 = Convert.FromBase64String(_body); int charCount8 = utf8Decode.GetCharCount(todecode_byte8, 0, todecode_byte8.Length); char[] decoded_char8 = new char[charCount8]; utf8Decode.GetChars(todecode_byte8, 0, todecode_byte8.Length, decoded_char8, 0); _body = new String(decoded_char8); Obviously, the culprit ".NET" programmer responsible kinda missed the alternative solution: _body = Encoding.UTF8.GetString( Convert.FromBase64String( _body ) ); And I wish this was the only occurrence of this..

    P 1 Reply Last reply
    0
    • E Erik Burger

      I was rewriting an application when I came across the following snippit: System.Text.UTF8Encoding encoder8 = new System.Text.UTF8Encoding(); System.Text.Decoder utf8Decode = encoder8.GetDecoder(); byte[] todecode_byte8 = Convert.FromBase64String(_body); int charCount8 = utf8Decode.GetCharCount(todecode_byte8, 0, todecode_byte8.Length); char[] decoded_char8 = new char[charCount8]; utf8Decode.GetChars(todecode_byte8, 0, todecode_byte8.Length, decoded_char8, 0); _body = new String(decoded_char8); Obviously, the culprit ".NET" programmer responsible kinda missed the alternative solution: _body = Encoding.UTF8.GetString( Convert.FromBase64String( _body ) ); And I wish this was the only occurrence of this..

      P Offline
      P Offline
      peterchen
      wrote on last edited by
      #2

      Could have been me - I remember myself digging through that Encoding documentation in MSDN - it is really badly documented, no concepts, just a bunch of classes and members. (IIRC I had to serialize to/from base64, and it was driving me crazy)


      Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
      We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
      Linkify!|Fold With Us!

      E 1 Reply Last reply
      0
      • P peterchen

        Could have been me - I remember myself digging through that Encoding documentation in MSDN - it is really badly documented, no concepts, just a bunch of classes and members. (IIRC I had to serialize to/from base64, and it was driving me crazy)


        Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
        We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
        Linkify!|Fold With Us!

        E Offline
        E Offline
        Erik Burger
        wrote on last edited by
        #3

        Oh I couldn't agree more on the level of documentation on this (or the lack thereof). If I were writing this, a little voice in the back of my head would go 'Come on man, there's an easier way to do this, right?'. And I've taught myself to listen to that voice ;) That, and using the Convert class A LOT :p

        P 1 Reply Last reply
        0
        • E Erik Burger

          Oh I couldn't agree more on the level of documentation on this (or the lack thereof). If I were writing this, a little voice in the back of my head would go 'Come on man, there's an easier way to do this, right?'. And I've taught myself to listen to that voice ;) That, and using the Convert class A LOT :p

          P Offline
          P Offline
          peterchen
          wrote on last edited by
          #4

          ErikDD wrote:

          a little voice in the back of my head would go 'Come on man, there's an easier way to do this, right?'. And I've taught myself to listen to that voice

          I've got that voice a lot lately... but obviously, it only tells YOU about the solution :cool:


          Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
          We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
          Linkify!|Fold With Us!

          E 1 Reply Last reply
          0
          • P peterchen

            ErikDD wrote:

            a little voice in the back of my head would go 'Come on man, there's an easier way to do this, right?'. And I've taught myself to listen to that voice

            I've got that voice a lot lately... but obviously, it only tells YOU about the solution :cool:


            Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
            We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
            Linkify!|Fold With Us!

            E Offline
            E Offline
            Erik Burger
            wrote on last edited by
            #5

            Ooo I feel special :cool:

            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