Android Question Filenames with High bit characters in files directory prevent B4A compling

MrKim

Well-Known Member
Licensed User
Longtime User
I am trying to add some .mp3 and wave files to my app and would prefer to keep the filenames with things like this:
B4X:
Fēn fēnzhōng
but B4A refuses to compile.
B4X:
....
Compiling resources    (0.27s)
Linking resources    Error
..\Files\AudioFiles\minute-Fen fenzhong.mp3: error: failed to open file.
any simple solution?
I see also older post where others were having trouble opening file like this so I am wondering if that is going to be an issue as well?
 

DonManfred

Expert
Licensed User
Longtime User
Create a textfile which maps from
minute-Fen fenzhong
to
Fēn fēnzhōng

Use only A-Z, A-Z, -, _, 0-9 in filenames.
 
Upvote 1

MrKim

Well-Known Member
Licensed User
Longtime User
Create a textfile which maps from
minute-Fen fenzhong
to
Fēn fēnzhōng

Use only A-Z, A-Z, -, _, 0-9 in filenames.
Ugh, I generating the filenames automatically and there will be a lot. You have any idea how to co convert them automatically i.e.. map the characters to regular ASCII?
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
This is pure speculation and probably won't help you in any way, but I remember that compilation renames all files to be lowercase.

Perhaps there's simply a problem converting "Fēn fēnzhōng" to "fēn fēnzhōng". And by that I don't mean the initial "F" but converting the characters with macrons to lowercase. (Which they already are, but you probably understand what I mean.)

You have any idea how to co convert them automatically i.e.. map the characters to regular ASCII?
I had a quick chat with ChatGPT. Assume it's insane and hallucinate about everything, but at least it claims to be able to do it. Perhaps there's some inspiration to find in there:
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Ugh, I generating the filenames automatically and there will be a lot. You have any idea how to co convert them automatically i.e.. map the characters to regular ASCII?
If the names are not too long then using ByteConverter.HexFromBytes(Name.GetBytes("utf8")) will do the job.
 
Upvote 0
Top