Предыдущая тема :: Следующая тема |
Автор |
Сообщение |
Snap666 Гость
|
Добавлено: Чт Ноя 07 2002 09:22 Заголовок сообщения: Странный косяк с кодировкой в ASP (изменено) |
|
|
Здравствуйте.
Мой сайт находится на канадском(!) сервере... У меня на странице обнаружился неожиданный косяк... У меня в разделе (каталоге) есть чтение из TXT-файлов объектом "Scripting.FileSystemObject" (т.е. текст в разделе написан не на самой HTML-странице, а берётся из текстовых файлов)... Там вот именно этот текст выводится не по-русски, а что-то типа "aaioi?eaoenu ia ioai?a aunieiea?anoaaiiiai nu?uy, ii a niaaoi?noaa n iaiei ec naiuo ecaanoiuo ia?o?"... Всё остальное на странице отображается нормально по-русски (и из баз данных русский текст тоже без проблем выводится на этой же странице)...
У меня в верху ASP-страницы есть параметр <%@ Language=VBScript codepage=1251 %> , есть и МетаТег <Meta Http-Equiv="Content-Type" Content="Text/Html; Charset=windows-1251"> и я даже добавил Response.CodePage = 1251 и Response.CharSet = "windows-1251" ... - не помогает !
Что мне делать ? Мне черезвычайно важен этот вывод из TXT-файлов... У меня каталог на 300 наименований (соответственно, столько же и txt-файлов)...
Может есть какое-то свойство у объекта "Scripting.FileSystemObject", устанавливающее кодировку ?
P.S. Я даже пробовал сохранить txt-фаил в юникоде - вообще весь текст на странице испортился...
Просьба - напишите подробно что, где и как сделать (изменить)... Буду очень признателен |
|
Вернуться к началу |
|
|
iamyuras Гость
|
Добавлено: Вс Ноя 10 2002 12:18 Заголовок сообщения: Re: Странный косяк с кодировкой в ASP (изменено) |
|
|
Прочитай в самом конце о FORMAT опциях. Попробуй их специфицировать, поиграться с ними. Туда же можешь запихать Юникод-файлы...
MSDN гласит:
FileSystemObject.OpenTextFile Method Description Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file. Syntax object.OpenTextFile(filename[, iomode[, create[, format]]]) The OpenTextFile method has these parts:
Part Description object Required. Always the name of a FileSystemObject. filename Required. String expression that identifies the file to open. iomode Optional. Indicates input/output mode. Can be one of three constants: ForReading, ForWriting, or ForAppending. create Optional. Boolean value that indicates whether a new file can be created if the specified filename doesn't exist. The value is True if a new file is created; False if it isn't created. The default is False. format Optional. One of three Tristate values used to indicate the format of the opened file. If omitted, the file is opened as ASCII.
Settings The iomode argument can have either of the following settings: Constant Value Description ForReading 1 Open a file for reading only. You can't write to this file. ForWriting 2 Open a file for writing only. You can't read from this file. ForAppending 8 Open a file and write to the end of the file.
The format argument can have any of the following settings:
Constant Value Description TristateUseDefault -2 Opens the file using the system default. TristateTrue -1 Opens the file as Unicode. TristateFalse Opens the file as ASCII. |
|
Вернуться к началу |
|
|
|