Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > General Discussion
  New Posts New Posts RSS Feed - Special Characters File names
  FAQ FAQ  Forum Search   Register Register  Login Login

Special Characters File names

 Post Reply Post Reply
Author
Message Reverse Sort Order
Ilana View Drop Down
Beginner
Beginner


Joined: 22 Nov 11
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ilana Quote  Post ReplyReply Direct Link To This Post Topic: Special Characters File names
    Posted: 23 Nov 11 at 9:50PM
Thanks!
For future users, here is the actual code, that works:
In C++:
char *fname = "C:\\Temp\\Digi drop\\ùéèçà123\\pages.pdf";
const int SIZE = 1024; // Bytes
                char* text = new char[SIZE];
                WCHAR w[SIZE]={0};

int erg=MultiByteToWideChar(CP_ACP, 0, fname, -1, w, SIZE); // ANSI to UNICODE
erg=WideCharToMultiByte(CP_UTF8, 0, w, -1, text, SIZE, 0, 0); // UNICODE to UTF-8 
int hndFile = _QuickPDFDAOpenFile (InstanceID, text, NULL);
if (hndFile != 0)
{
int x = 1;
}
In Java 6 - How to get the same UFT-8 path:
public String getAsString (String result)  
        { 
byte[] bt = result.getBytes(); 
ByteArrayOutputStream sw = new ByteArrayOutputStream (bt.length);
                OutputStreamWriter osw;
try {
osw = new OutputStreamWriter (sw, "UTF8");
       BufferedWriter out = new BufferedWriter (osw); 
       out.write(result ); 
       out.close(); 
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
        return sw.toString(); 
    }


Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 23 Nov 11 at 8:50AM
Hi Ilana!

Wheeley already told you what to do ...
Try things like this:
QP.LoadFromFile(Pchar( AnsiToUtf8(c:\\drop\\ùéèçà 1232\\pages.pdf) ))
QP.LoadFromFile(UTF8Encode('c:\\drop\\ùéèçà 1232\\pages.pdf')

...and don't forget Wheeley's ideas 2 and 3 ;-)

Cheers and welcome here,
Ingo

Back to Top
Ilana View Drop Down
Beginner
Beginner


Joined: 22 Nov 11
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ilana Quote  Post ReplyReply Direct Link To This Post Posted: 22 Nov 11 at 10:58PM
I am using UTF-8 characters which has their value is bigger then 127. For example one of the characters has the Ansi value  of 199 and 200. Can you please advice? Thanks, Ilana.
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 22 Nov 11 at 5:48AM
I can think of 3 ideas.
1. Make sure you send the file name as a UTF8 encoded string to the 7.23 DLL.
2. Try the 7.26 DLL with UTF8 encoding as well
3. Upgrade to version 8 with full unicode support

Wheeley
Back to Top
Ilana View Drop Down
Beginner
Beginner


Joined: 22 Nov 11
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ilana Quote  Post ReplyReply Direct Link To This Post Posted: 22 Nov 11 at 3:30AM
Hi,

When trying to open a pdf file in a directory that has German characters, the returned handle is 0. Which means that the file could not be opened.
The command DAOpenFile when the file is: "c:\\drop\\ùéèçà1232\\pages.pdf". Any solution for that?
I am using "QuickPDFDLL0723.dll".

Thanks,
Ilana.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store