ByteArray - Store data with another charset (ibm850) to a database | ActiveX/VBSScript registry editor
ActiveX NT User account manager
Export MDB/DBF from ASP
Url replacer, IIS url rewrite Active LogFile Email export ActiveX/ASP Scripting Dictionary object
| ||
| Sample for ScriptUtils.ByteArray.HexString |
CREATE TABLE [dbo].[textTable] ( [textColumn] [VARCHAR] (250) COLLATE SQL_AltDiction_CP850_CI_AI NULL ) ON [PRIMARY]but your ASP will work with utf-8, you need a binary conversion between utf-8 and ibm850.
| ByteArray - Store data with another charset (ibm850) to a database | |
|---|---|
<%@ Codepage=65001 %> <% 'set response charset to the same charset as the ASP page hase ' Codepage=65001 -> charset="utf-8", see ConvertCodePages Response.CharSet = "utf-8" Dim UnicodeString UnicodeString = Request.QueryString("text1") 'response.write "<br>UnicodeString:" & UnicodeString 'set the data to ByteArray object Dim ByteArray Set ByteArray = CreateObject("ScriptUtils.ByteArray") ByteArray.CharSet = "ibm850" ByteArray.String = UnicodeString 'ByteArray.ByteArray contains "ibm850" data now. 'Create an SQL command SQL = "insert into TextTable (textColumn) values ( 0x" & ByteArray.HexString & ")" 'response.write "<br>" & SQL 'or 'SQL = "Update TextTable set textColumn = 0x" & ByteArray.HexString 'SQL = SQL & " where Cond_Column=Cond_Value" 'The TextTable should be created as: ' CREATE TABLE [dbo].[textTable] ( ' [textColumn] [varchar] (250) COLLATE SQL_AltDiction_CP850_CI_AI NULL ') ON [PRIMARY] Set rConn = CreateObject("ADODB.Connection") rConn.Open "connection to the SQL server" rConn.Execute SQL %> <form> <input type="text" name="text1" value="ìšèøžýáíé" /> <input type="submit" /> </form> | |