1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Convert string charset with ASP

Discussion in 'C#' started by Kyriakos, Feb 4, 2011.

  1. #1
    Hi,

    Is there any ASP script that can convert the charset of a string from UTF-8 in WINDOWS-1253? I have found a script in PHP only but my pages are in ASP.

    this is the PHP script

    $string = mb_convert_encoding($string, "utf8", "greek") 
    PHP:
    is there any equivalent script in ASP?
    SEMrush
    Thanks in advance.
     
    Kyriakos, Feb 4, 2011 IP
    SEMrush
  2. gotlivechat

    gotlivechat Member

    Messages:
    516
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    35
    #2
    gotlivechat, Feb 4, 2011 IP
  3. Kyriakos

    Kyriakos Active Member

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    Yes. I want to convert the charset of the string before the INSERT INTO a database table.
     
    Kyriakos, Feb 7, 2011 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,681
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
  5. Kyriakos

    Kyriakos Active Member

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    Why ASP is so complecated and stupid? In PHP all scripts are so simple and understandable.
     
    Kyriakos, Feb 7, 2011 IP
  6. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,681
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Not really, but you are talking about something that came about in the mid 90s which is more or less the dawn of the internet as anything more than just for geeks.

    Its much a question of why the hell your doing a site in such an old technology as .Net is much more straight forward, logical and obviously massively better than both classic ASP and PHP
     
    AstarothSolutions, Feb 7, 2011 IP
  7. Kyriakos

    Kyriakos Active Member

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #7
    I have found the website of my company allready builded in ASP and i can't change it in asp.net just like that. Also i don't know ASP.NET at all.
    I use PHP outside my work because is the most popular scripting language and i can find plenty of PHP tools and scripts over the web. Neither ASP and ASP.NET have so many free scripts and tools. Also PHP is open source and i don't have to pay for windows, SQL server etc.
     
    Kyriakos, Feb 8, 2011 IP
  8. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,681
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You dont have to pay for SQL server with .Net either as SQL Express can run databases up to 2 gig or you can still use MySQL with .Net too.

    Whilst it isnt good practice, most VBScript will run in a VB.Net environment it is just inefficient (as non-compiled scripting languages are in comparison). Have known more than one person to simply make all their Classic ASP into ASP.Net without changing any of the actual coding and then over time replace the VBScript with .Net

    You only need 1 tool with .Net and that is Visual Studio or the free ASP.Net version of it.
     
    AstarothSolutions, Feb 8, 2011 IP
  9. trackpaps

    trackpaps Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Try something like this
    Dim theString As String = "Hello, World!"
    Dim utf8 As Encoding = Encoding.UTF8
    Dim greek As Encoding = Encoding.GetEncoding("windows-1253")

    Dim unicodeBytes As Byte() = greek.GetBytes(theString)
    Dim asciiBytes As Byte() = Encoding.Convert(greek, utf8, unicodeBytes)

    Dim asciiChars(utf8.GetCharCount(asciiBytes, 0, asciiBytes.Length)) As Char
    utf8.GetChars(asciiBytes, 0, asciiBytes.Length, asciiChars, 0)
    Dim asciiString As New String(asciiChars)

    http://
    msdn.
    microsoft.
    com/en-us/library/system.text.encoding.convert(v=vs.71).
    aspx
     
    trackpaps, Feb 16, 2011 IP
  10. prptl709

    prptl709 Guest

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    This will convert String into character or opposite?
     
    prptl709, Feb 25, 2011 IP