On 04/04/2016 17:00, Dimitry Sibiryakov wrote: > 04.04.2016 11:47, Alex Peshkoff wrote: >> If we store all strings in uppercase >> this will end with creating of DB.FDB instead db.fdb. Or I miss >> something here? > Yes. That's how Firebird already works for ages. > >> Method 3 is good when talking about comparison, but for all other usages >> we will have conversion overhead almost for nothing. Not sure that >> overall result will be so efficient. > "All other usages" of file names are, actually, only raising of > exceptions on errors. > They are not frequent enough to slow down overall performance. Or I miss > something here? > >> Or you talk about always using >> unicode (suppose, you mean unicode16) strings in firebird, not utf8? > I'd rather imagine using unicode in its platform native style: utf-16 on > Windows and > utf-8 on posix. > Bear in mind that we also have the problem of permitted/forbidden characters. Not that I know firebird internals, but I gather you have "pathname" which is firebird-specific. imho that should then be converted to "localpathname" which is OS-specific. Somebody said you're case-insensitive and if "pathname" is "database.db", what actually gets created in the filesystem is "DATABASE.DB". Imho, on nix, that is a *major* mistake.
I've had the nasty experience of working on a database where "*" was a perfectly acceptable character in what got turned into a filename. We ported to nix and guess what - things blew up pretty spectacularly (made worse in that * had a special meaning and was therefore used all over the place :-) So imho, you should have two very clearly delineated datatypes - a "filename" which is what firebird expects internally and you can do what you like with it, and a "localfilename" which abides by conventions of the filesystem it's on. That means, on Windows, it's case-insensitive utf-16, on nix it's case-sensitive utf-8, and elsewhere it can be whatever you decide. It's a bit more work, it's a bit more abstraction, but it's clean, clearly defined, and where (as it must be) it's implementation-defined, it's also clearly defined where the implementation belongs. (And then, if you get things like my "*" problem, you can deal with it in the conversion from "pathname" to "localpathname" and vice versa.) Cheers, Wol ------------------------------------------------------------------------------ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
