将vbCrLF附加到UCS-2 Little Endian [英] Append vbCrLF to UCS-2 Little Endian
问题描述
我正在通过HP-UFT(以前的QTP)使用vbscript. 我面临的问题看起来很简单,但无法解决.
I'm using vbscript via HP-UFT (former QTP). I'm facing with issue which looks pretty simple but I couldn't fix it.
我从某些系统导出了.CSV文件,并且该文件中没有完成的CRLF.
I have .CSV files exported from some system and there is no finished CRLF in this file.
我需要一个简单的修复程序来对此文件追加新行(我知道这可能是写入另一个文件的解决方法) 我正在像这样使用FileSystemObject:
I need a simple fix to append new line to this file (I know that is possible write-to-another-file workaround) I'm using FileSystemObject like this:
Set objFile = objFSO.OpenTextFile(outFile,8)' (outFile,8, true/false/default)
objFile.Write "test string" & vbCrLf ' and other different combinations
我没有使用ADODB.Stream,因为它没有附加功能,也不需要其他文件
I didn't use ADODB.Stream because it has not append function and I have no need to additional files
尝试后在记事本中打开文件时,看到的是空正方形而不是CRLF.我认为是因为使用UCS-2 Little Endian编码创建的文件.我对utf-8没有这样的问题
When I'm opening file in Notepad after my tries I see empty squares instead CRLF. I think it because file created with UCS-2 Little Endian encoding. I have no such issue with utf-8
PS也许可以更快速地修复系统变量?我在网络中发现可以通过某些系统变量来更改所有创建文件的默认编码,但找不到它的名称. 我在区域和语言中的语言->管理->非Unicode语言是英语
PS maybe some more quick fix of system variable is possible? I have found in network that it possible to change default encoding for all created files via some system varibale but din't find it name. My Language in Region and Language -> Administrative -> Language for non-Unicode is English