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. General Programming
  3. C#
  4. Making string HTML compliant

Making string HTML compliant

Scheduled Pinned Locked Moved C#
html
3 Posts 2 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.
  • T Offline
    T Offline
    tommazzo
    wrote on last edited by
    #1

    Hi! Is there a way of making a string html compliant (i.e. replacing german umlauts with the appropriate hex code), without hardcoding each character's translation.

    T 1 Reply Last reply
    0
    • T tommazzo

      Hi! Is there a way of making a string html compliant (i.e. replacing german umlauts with the appropriate hex code), without hardcoding each character's translation.

      T Offline
      T Offline
      techieboi
      wrote on last edited by
      #2

      Check out System.Web.HttpServerUtility.HtmlEncode(string) Hope this helps

      T 1 Reply Last reply
      0
      • T techieboi

        Check out System.Web.HttpServerUtility.HtmlEncode(string) Hope this helps

        T Offline
        T Offline
        tommazzo
        wrote on last edited by
        #3

        Thanks a lot! That was exactly what I meant. Although I must say that HttpServerUtility is only usable from within an ASP.NET application, for normal Windows apps HttpUtility has to be used.

        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