我正在使用vbscript从db2中提取数据并写入文件.写入文件如:
Set objTextFile = objFSO.CreateTextFile(sFilePath, True, True)
Run Code Online (Sandbox Code Playgroud)
以unicode创建文件.但那是xml文件,它使用UTF-8.因此,当我用MS XML Notepad打开xml文件时,它会抛出错误:'十六进制值0x00是无效字符'
所以我用TextPad打开这个文本文件并保存为UTF-8.之后,XML打开没有任何问题.我可以通过vbScript将文件从Unicode转换为UTF-8吗?
使用Path按钮上的以下方法单击:
public static void pathButtonAction() {
JFileChooser chooser = new JFileChooser();
if (pathToInbound == null) { //private static File pathToInbound;
chooser.setCurrentDirectory(new java.io.File("."));
} else {chooser.setCurrentDirectory(pathToInbound);
}
chooser.setDialogTitle("Choose folder with messages to send");
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
pathToInbound = chooser.getCurrentDirectory();
addLogText(chooser.getCurrentDirectory().getAbsolutePath());
}
}
Run Code Online (Sandbox Code Playgroud)
但在这里我选择文件夹c:\ windows\temp这里addLogText(chooser.getCurrentDirectory().getAbsolutePath())我只能记录c:\ windows.为什么临时文件夹被忽略/截断?
我需要解析看起来像的SWIFT消息:: 15A :: 20:REFERENCE:21:NEW:15B :: 30T:
我需要解析它:...:符号.问题在于:可以是3个和2个字符.那可能吗?