Hi,
in your code you change the filename from ANSI to OEM. Why ?
The filesystem since Windows NT is in ANSI.
Why do you use the shell command, instead of the DIR$ function, this function will always get the right name for operations.
Announcement
Collapse
No announcement yet.
Icelandic characters in DOS filenames
Collapse
X
-
Code:AsciiBuff = Space$(Len(LastFile)+1) CharToOem ByVal StrPtr(LastFile),ByVal StrPtr(AsciiBuff)
Try:
A: Only initialize ASciiBuff to LEN(LastFile), not Len(Lastfile) + 1
B. Instead of spaces, try $NUL (CHR$(0))
Leave a comment:
-
You should be able to use any extended ASCII character except CHR$(229). I can't tell if you have that in your file names.
CHR$(229) is reserved in that it sets up the DELeted flag for a file for the O/S so if you do use it, you will probably error out.
At least I think it's CHR$(229). Pretty sure. It's been a while since I had to take it into consideration.
Leave a comment:
-
Icelandic characters in DOS filenames
I am using Windows DIR /c
My directory is: c:\Isl
English.txt
Eða.txt
Áéíóúýþæðö.txt
Ísland.txt
I run this program :
#Include "Win32api.inc"
Function PBMain
Local LastFile As String,AsciiBuff As String
Shell "cmd /c dir c:\isl\*.* /b > dir.dir"
Open "dir.dir" For Input As 1
While Not Eof(1)
Line Input #1,LastFile
AsciiBuff = Space$(Len(LastFile)+1)
CharToOem ByVal StrPtr(LastFile),ByVal StrPtr(AsciiBuff)
Err=0
Open "c:\isl\"+AsciiBuff For Input As 2
? AsciiBuff "->";Error$(Err)
Close 2
Wend
Close 1
End Function
And my output is:
English.txt->No Error
EÐa.txt->File not found
µ'¡¢£ìç'Ð".txt->Path/file access error
Ösland.txt->File not found
Still unable to open files with Icelandic char.Tags: None
Leave a comment: