![]() |
![]() |
|
кодировка текста в файлах созданных Scripting.FileSystemObject Ø |
☑ | ||
---|---|---|---|---|
0
wows
21.11.05
✎
11:52
|
Как установить кодировку текста созданного Scripting.FileSystemObject. Необходимо использовать UTF-8...
А пишет похоже в текущей кодировке виндовоса... |
|||
1
smaharbA
21.11.05
✎
12:00
|
Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.
object.OpenTextFile(filename[, iomode[, create[, format]]]) Arguments object Required. Object is always the name of a FileSystemObject. filename Required. String expression that identifies the file to open. iomode Optional. 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. If omitted, a new file isn't created. 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 any 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. ForAppending 8 Open a file and write to the end of the file. The format argument can have any of the following settings: Value Description TristateTrue Open the file as Unicode. TristateFalse Open the file as ASCII. TristateUseDefault Open the file using the system default. |
|||
2
Gloom
21.11.05
✎
12:02
|
Через FileSystemObject в UTF-8 не получится(либо ANSI, либо юникод).
Но можно заюзать adodb.stream... |
|||
3
SilentMan
21.11.05
✎
12:16
|
2(2) А UTF - это разве не юникод? 8-()
|
|||
4
smaharbA
21.11.05
✎
12:20
|
(3) UTF-16
|
|||
5
Gloom
21.11.05
✎
12:21
|
(3)Как бы не совсем. В utf-8 в юникод кодируются только символы старше 127, а до этого - ascii...
|
|||
6
wows
21.11.05
✎
12:35
|
А как можно сделать именно в UTF-8. У нас в налоговой отчетность на xml сделана. Переделывать старую выгрузку пробовал, потом бросил. Проще напрямую в файл писать и все...
|
|||
7
wows
21.11.05
✎
12:38
|
т.е. мне нужно файл только создавать. Читать его в 1С уже никто не будет. Это для программы ISID client.
|
|||
8
smaharbA
21.11.05
✎
12:52
|
Stream = CreateObject("Adodb.Stream");
Stream.Charset="utf-8"; Stream.Type = 2; Stream.Mode= 3; Stream.Open(); Stream.WriteText("Проверочка!!!"); Stream.SaveToFile("c:\utf-8.txt"); |
|||
9
wows
21.11.05
✎
13:12
|
smaharbA - спасибо. Буду пробовать. Если не сложно выложи полный список команд.
|
|||
10
smaharbA
21.11.05
✎
13:17
|
http://www.w3schools.com/ado/ado_ref_stream.asp
|
|||
11
wows
21.11.05
✎
13:35
|
smaharbA - спасибо. Буду почитать :)
Мне нужно из него файл создать с построчной записью... т.е. 1. 2. 3. и т.д. А он скидывает все одной строкой. Что не есть хорошо. |
|||
12
smaharbA
21.11.05
✎
13:39
|
Stream.WriteText("Проверочка!!!", 1 );
|
|||
13
wows
21.11.05
✎
13:44
|
smaharbA - еще раз спасибо.
Как раз дочитал до этого места :) Все заработало как нужно. Теперь буду создавать отчет... 50 листов исходного кода :) |
Форум | Правила | Описание | Объявления | Секции | Поиск | Книга знаний | Вики-миста |