Re: [firebird-support] embedded database with Chinese path

2017-10-03 Thread Hamish Moffatt ham...@risingsoftware.com [firebird-support]
On 03/10/17 11:25, Hamish Moffatt ham...@risingsoftware.com 
[firebird-support] wrote:


I'm trying to connect to a database with a filename containing Chinese
characters.



I tried passing a UTF-8 encoded filename, with the isc_dpb_utf8_filename 
flag set. However, this is failing with a "transliteration error" 
because ISC_utf8ToSystem() is trying to convert the UTF-8 to wchar (ok) 
and then to ANSI, which is not ok because of the Chinese filename. It 
looks like the Chinese filename will just not work using encoded filenames.


But I can't figure out why the Windows short filename doesn't work - it 
seems Firebird is converting it back somewhere, and then failing on that?


Hamish


Re: [firebird-support] embedded database with Chinese path

2017-10-03 Thread Hamish Moffatt ham...@risingsoftware.com [firebird-support]
On 03/10/17 18:20, Hamish Moffatt ham...@risingsoftware.com 
[firebird-support] wrote:



But I can't figure out why the Windows short filename doesn't work - 
it seems Firebird is converting it back somewhere, and then failing on 
that?


isc_file.cpp converts the short filename back to a long filename.

So, it looks like a filename containing >8-bit characters is simply not 
going to work on Windows with Firebird. UTF-8 gets converted back to 
8-bit ANSI, and short filenames get converted back to long filenames in 
an 8-bit string also.


I'm just trying to store a db in the user's home directory, which may 
contain Chinese characters if their login name does. Windows allows this.



Hamish


Re: [firebird-support] embedded database with Chinese path

2017-10-03 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
03.10.2017 2:25, Hamish Moffatt ham...@risingsoftware.com [firebird-support] 
wrote:
> Any ideas?

   Give up. Firebird does not support unicode characters in database name and 
path. Only ANSI.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] embedded database with Chinese path

2017-10-03 Thread Kjell Rilbe kjell.ri...@marknadsinformation.se [firebird-support]
Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] skrev:
> 03.10.2017 2:25, Hamish Moffatt ham...@risingsoftware.com [firebird-support] 
> wrote:
>> Any ideas?
> Give up. Firebird does not support unicode characters in database name 
> and path. Only ANSI.

Forgive me for butting in, but... Perhaps it's high time to change FB 
then? Unicode is "everywhere" these days, and FB should keep up.

Just my opinion of course.

Kjell






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] embedded database with Chinese path

2017-10-03 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
03.10.2017 11:05, Kjell Rilbe kjell.ri...@marknadsinformation.se 
[firebird-support] wrote:
> Forgive me for butting in, but... Perhaps it's high time to change FB
> then? Unicode is "everywhere" these days, and FB should keep up.

   It is a lot of work, so the path 
(https://github.com/aafemt/firebird/tree/unicode) was 
big and broke some functionality. Core developers rejected it.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] embedded database with Chinese path

2017-10-03 Thread Hamish Moffatt ham...@risingsoftware.com [firebird-support]
On 03/10/17 19:59, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:
> 03.10.2017 2:25, Hamish Moffatt ham...@risingsoftware.com [firebird-support] 
> wrote:
>> Any ideas?
> Give up. Firebird does not support unicode characters in database name 
> and path. Only ANSI.
>
>

Thanks for confirming what I figured from the source. But this is 
exactly what the Windows short path names are for - if your application 
can't handle Unicode filenames, use the short names. I tried it and it 
fails. Firebird explicitly converts the short path name back to a long 
name it can't use?!

It seems to mostly work with UTF-8 on linux, or at least I had it 
working a couple of years back.


Hamish







++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] embedded database with Chinese path

2017-10-04 Thread DougC d...@moosemail.net [firebird-support]
Hamish-



Windows short path names are decidedly NOT for apps that cannot handle Unicode. 
They were introduced far earlier than that and were intended for programs that 
could not handle anything but the short 8.3 limits for any given file or folder 
name. That they often help with avoiding unicode is a side effect.



Sound like your misunderstanding of this may be contributing to your 
frustration.



Doug C.





 On Tue, 03 Oct 2017 23:25:23 -0400 Hamish Moffatt 
ham...@risingsoftware.com [firebird-support] 
 wrote 




On 03/10/17 19:59, Dimitry Sibiryakov s...@ibphoenix.com 

[firebird-support] wrote: 

> 03.10.2017 2:25, Hamish Moffatt ham...@risingsoftware.com 
[firebird-support] wrote: 

>> Any ideas? 

> Give up. Firebird does not support unicode characters in database name and 
path. Only ANSI. 

> 

> 

 

Thanks for confirming what I figured from the source. But this is 

exactly what the Windows short path names are for - if your application 

can't handle Unicode filenames, use the short names. I tried it and it 

fails. Firebird explicitly converts the short path name back to a long 

name it can't use?! 

 

It seems to mostly work with UTF-8 on linux, or at least I had it 

working a couple of years back. 

 

 

Hamish 







Re: [firebird-support] embedded database with Chinese path

2017-10-04 Thread Richard Damon rich...@damon-family.org [firebird-support]
Short File names are to allow apps that can't support long file names 
(LFN) to access a file. Long filename support includes wchar encoding. 
If Firebird can't supportĀ  wchar filenames, then it should NOT convert a 
short filename to its LFN equivalent (unless there is some other very 
important reason it needs the LFN).


On 10/4/17 7:15 AM, DougC d...@moosemail.net [firebird-support] wrote:
> Hamish-
>
> Windows short path names are decidedly NOT for apps that cannot handle 
> Unicode. They were introduced far earlier than that and were intended 
> for programs that could not handle anything but the short 8.3 limits 
> for any given file or folder name. That they often help with avoiding 
> unicode is a side effect.
>
> Sound like your misunderstanding of this may be contributing to your 
> frustration.
>
> Doug C.
>
>
>  On Tue, 03 Oct 2017 23:25:23 -0400 *Hamish Moffatt 
> ham...@risingsoftware.com [firebird-support] 
> * wrote 
>
> On 03/10/17 19:59, Dimitry Sibiryakov s...@ibphoenix.com
> 
> [firebird-support] wrote:
> > 03.10.2017 2:25, Hamish Moffatt ham...@risingsoftware.com
>  [firebird-support] wrote:
> >> Any ideas?
> > Give up. Firebird does not support unicode characters in
> database name and path. Only ANSI.
> >
> >
>
> Thanks for confirming what I figured from the source. But this is
> exactly what the Windows short path names are for - if your
> application
> can't handle Unicode filenames, use the short names. I tried it
> and it
> fails. Firebird explicitly converts the short path name back to a
> long
> name it can't use?!
>
> It seems to mostly work with UTF-8 on linux, or at least I had it
> working a couple of years back.
>
>
> Hamish
>

-- 
Richard Damon



Re: [firebird-support] embedded database with Chinese path

2017-10-04 Thread Hamish Moffatt ham...@risingsoftware.com [firebird-support]

On 04/10/17 22:15, DougC d...@moosemail.net [firebird-support] wrote:

Hamish-

Windows short path names are decidedly NOT for apps that cannot handle 
Unicode. They were introduced far earlier than that and were intended 
for programs that could not handle anything but the short 8.3 limits 
for any given file or folder name. That they often help with avoiding 
unicode is a side effect.


Sound like your misunderstanding of this may be contributing to your 
frustration.


Doug,

I'm aware that short filenames are a work around for applications which 
can't support long filenames (which date from Windows 95). They also 
seem to nicely work around applications which are too dumb to support 
valid Windows 16-bit filenames, like Firebird. I don't agree that it's 
just a side effect that they avoid unicode, since I had unicode parts 
that fit in the 8.3 short filename format.


I realise that Firebird needs to use either long or short names 
consistently so as to avoid inadvertently opening the same file by 
different names (with locking issues and the like), but the solution is 
to use only short names or handle long names properly.


Hamish


Re: [firebird-support] embedded database with Chinese path

2017-10-05 Thread Helen Borrie hele...@iinet.net.au [firebird-support]
Hello Hamish,

Thursday, October 5, 2017, 4:53:24 PM, you wrote:

[...] all that

Have you considered trying a symbolic link?
https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/



Re: [firebird-support] embedded database with Chinese path

2017-10-05 Thread Richard Damon rich...@damon-family.org [firebird-support]
On 10/4/17 11:53 PM, Hamish Moffatt ham...@risingsoftware.com 
[firebird-support] wrote:
>
> On 04/10/17 22:15, DougC d...@moosemail.net [firebird-support] wrote:
>> Hamish-
>>
>> Windows short path names are decidedly NOT for apps that cannot 
>> handle Unicode. They were introduced far earlier than that and were 
>> intended for programs that could not handle anything but the short 
>> 8.3 limits for any given file or folder name. That they often help 
>> with avoiding unicode is a side effect.
>>
>> Sound like your misunderstanding of this may be contributing to your 
>> frustration.
>
> Doug,
>
> I'm aware that short filenames are a work around for applications 
> which can't support long filenames (which date from Windows 95). They 
> also seem to nicely work around applications which are too dumb to 
> support valid Windows 16-bit filenames, like Firebird. I don't agree 
> that it's just a side effect that they avoid unicode, since I had 
> unicode parts that fit in the 8.3 short filename format.
>
> I realise that Firebird needs to use either long or short names 
> consistently so as to avoid inadvertently opening the same file by 
> different names (with locking issues and the like), but the solution 
> is to use only short names or handle long names properly.
>
> Hamish
>
One thing to note, the Short File Names (SFN) can't use 'Unicode' 
characters, only the Extended Ascii character set of the current code 
page (so it may seem you can put some unicode in them). SFNs can't be 
UTF-8. Note, that this also means that changing the system code page 
might change the apparent name of a file that used the extended 
character set, even the separator might change (on the Japanese code 
page, that is the Yen symbol).

The big selling point of Long File Names (LFN) was that they could be 
mostly arbitrary phrases in the users own language, breaking BOTH the 8 
character limit AND the 8 bit char restriction (using 16 bit wchar to 
encode them). There is no such beast as a 8 bit only LFN, or a 16 bit 
(Unicode) encoded SFN.

Every file has a SFN just so that applications (like it appears that 
Firebird is) that don't support LFNs can still access the files.

-- 
Richard Damon