|
Programmer's Reference
> ExcelTemplate
> AnsiToUnicode
AnsiToUnicode Method
Syntax:
Public Function UnicodeToAnsi(Ansi As String, CodePage As Long) Unicode As String
Description:
If a client submits a non-Latin alphabet string to a server
running a language different from the language of the client's HTML page,
to display the string correctly in an Excel
spreadsheet the string must be converted to Unicode.
The AnsiToUnicode method
takes a non-Latin alphabet string and its language's code page and returns a Unicode
string. If the client HTML script's charset property is set to the string's
language or to UTF-8, and the string is converted to Unicode using AnsiToUnicode,
the string will be displayed correctly in the generated spreadsheet.
For a complete list of charset and code page values see,
Character Set Recognition .
Example:
The following lines get a Hebrew string from an HTML form, convert the string to
Unicode, and insert the string at the FirstName data marker. The example
uses a specific language code page; to correctly display strings in any language, use
code page 65001.
<%
Set xlw = Server.CreateObject("Softartisans.ExcelTemplate")
...
HebrewString = xlw.ansitounicode(Request.Form("FirstName"), 1255)
xlw.Datasource("FirstName") = HebrewString
...
%>

Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.
|