Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - vbscript language conversions

Reply
 
Old 08-12-2008   #1 (permalink)
Dean g


 
 

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
Old 08-12-2008   #2 (permalink)
Anthony Jones


 
 

Re: vbscript language conversions


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

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

Thread Tools


Similar Threads
Thread Forum
How to do No hang up VBScript (nohup for 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
i don't have my language on installed input language Vista General
SID Conversions for elevated Restricted Users Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46