кодировка текста в файлах созданных Scripting.FileSystemObject #138427


#0 by wows
Как установить кодировку текста созданного Scripting.FileSystemObject. Необходимо использовать UTF-8...А пишет похоже в текущей кодировке виндовоса...
#1 by smaharbA
Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.ArgumentsobjectRequired. Object is always the name of a FileSystemObject.filenameRequired. String expression that identifies the file to open.iomodeOptional. Can be one of three constants: ForReading, ForWriting, or ForAppending.createOptional. 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. If omitted, a new file isn't created.formatOptional. One of three Tristate values used to indicate the format of the opened file. If omitted, the file is opened as ASCII.SettingsThe iomode argument can have any of the following settings:Constant Value DescriptionForReading 1 Open a file for reading only. You can't write to this file.ForWriting 2 Open a file for writing.ForAppending 8 Open a file and write to the end of the file.The format argument can have any of the following settings:Value DescriptionTristateTrue Open the file as Unicode.TristateFalse Open the file as ASCII.TristateUseDefault Open the file using the system default.
#2 by Gloom
Через FileSystemObject в UTF-8 не получится(либо ANSI, либо юникод).Но можно заюзать adodb.stream...
#3 by SilentMan
2 А UTF - это разве не юникод? 8-
#4 by smaharbA
UTF-16
#5 by Gloom
Как бы не совсем. В utf-8 в юникод кодируются только символы старше 127, а до этого - ascii...
#6 by wows
А как можно сделать именно в UTF-8. У нас в налоговой отчетность на xml сделана. Переделывать старую выгрузку пробовал, потом бросил. Проще напрямую в файл писать и все...
#7 by wows
т.е. мне нужно файл только создавать. Читать его в 1С уже никто не будет. Это для программы ISID client.
#8 by smaharbA
#9 by wows
smaharbA - спасибо. Буду пробовать. Если не сложно выложи полный список команд.
#10 by smaharbA
http://www.w3schools.com/ado/ado_ref_stream.asp
#11 by wows
smaharbA - спасибо. Буду почитать :)Мне нужно из него файл создать с построчной записью...т.е. 1.     2.     3.и т.д.А он скидывает все одной строкой.Что не есть хорошо.
#12 by smaharbA
Stream.WriteText("Проверочка!!!", 1 );
#13 by wows
smaharbA - еще раз спасибо.Как раз дочитал до этого места :)Все заработало как нужно.Теперь буду создавать отчет...50 листов исходного кода :)
Тэги:
Ответить:
Комментарии доступны только авторизированным пользователям