Windows Vista Forums

vbscript language conversions

  1. #1


    Dean g Guest

    vbscript language conversions

    hi,
    I have a webpage that accepts posts in another language, when i insert
    this post into my sql server database it automatically converts it to
    the form ฒൈ etc...

    This is fine as the browser then converts it back into the language. My
    problem is i am now importing text in that language straight into the
    database from an excell file. so i now i need to convert the language to
    the same format using vb. I have tried acsii and unicode but cant seem
    to get it in the same format of ฒ where it can be read by the
    browser.

    sorry if this doesnt quite fit the vbcript category i wasnt sure where i
    should post it.

    I'm getting desperate any help on this would be great.
    Regards,
    Dean



    *** Sent via Developersdex http://www.developersdex.com ***

      My System SpecsSystem Spec

  2. #2


    Anthony Jones Guest

    Re: vbscript language conversions


    "Dean g" <big_deanus@xxxxxx> wrote in message
    news:edXQ9RE$IHA.1224@xxxxxx

    > hi,
    > I have a webpage that accepts posts in another language, when i insert
    > this post into my sql server database it automatically converts it to
    > the form ฒൈ etc...
    >
    > This is fine as the browser then converts it back into the language. My
    > problem is i am now importing text in that language straight into the
    > database from an excell file. so i now i need to convert the language to
    > the same format using vb. I have tried acsii and unicode but cant seem
    > to get it in the same format of ฒ where it can be read by the
    > browser.
    >
    > sorry if this doesnt quite fit the vbcript category i wasnt sure where i
    > should post it.
    >
    Show us some code you have tried? How close have you got.

    Bad air code follows but is the general principle needed:-

    output = ""
    For i = 1 to Len(s)
    charCode = AscW(Mid(s, i, 1))
    If charCode > 127 Then
    output = output & "&#" & charcode & ";"
    else
    output = Mid(s, i, 1)
    End If
    Next

    Is there any way you stop storing the data like this, its not a good design
    choice to pollute persisted data with encodings for specific transport or
    presentation technologies. What if you wanted at some point to use a server
    side report generation tool that creates a PDF for example?


    --
    Anthony Jones - MVP ASP/ASP.NET



      My System SpecsSystem Spec


vbscript language conversions
Similar Threads
Thread Forum
are VBscript on Windows server 2003 and VBscript on WS2008 compatible? VB Script
Can a vbscript identify the program/process that called a vbscript VB Script
Powershell Wrapper Script Problems - Trying to Call PowershellExchange 2007 Commands from Secondary Language (Like VBScript) PowerShell
<SCRIPT LANGUAGE="VBScript"> and <%%> VB Script
SID Conversions for elevated Restricted Users Vista security