Loading...

Unicode path handling

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

Unicode path handling

Postby leiqunni » Tue May 04, 2010 8:41 am

hi there,

I'm using GdViewer with C++Builder 2010.
I noticed GdViewer has somethig wrong at Unicode path handling.

Image
img1

Look img1. this program send filename including Japanese character
(UTF-16) to DisplayFromFile method. 0x30DF is Japanese character.
this is okay. I can see 0.jpg and method return '0'.

Image
img2

and Look img2. it's same program except Japanese character change
0x30DF -> 0x30E0. this case DisplayFromFile method can't find file.
return code is '10'. of course file exist.

0x30DE - 0x30DF is okay. 0x30E0 - 0x30E5 is no good at least.
I have no idea about other characters.

I tested version 4.12.4 - 4.12.10.
4.12.3 probably has no trouble.

do u have any idea?
leiqunni
 
Posts: 11
Joined: Fri Jan 11, 2008 11:44 am

Re: Unicode path handling

Postby leiqunni » Sat May 29, 2010 10:01 pm

Now I test at VB 2010 writting little code.

Code: Select all
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '//                                                              vvvvvvv
        Dim file1 As String = ChrW(&H43) & ChrW(&H3A) & ChrW(&H5C) & ChrW(&H30DE) & ChrW(&H5C) & ChrW(&H30) & ChrW(&H2E) & ChrW(&H6A) & ChrW(&H70) & ChrW(&H67) & ChrW(&H0)
        AxGdViewer1.DisplayFromFile(file1) '// good
        '//                                                              vvvvvvv
        Dim file2 As String = ChrW(&H43) & ChrW(&H3A) & ChrW(&H5C) & ChrW(&H30E0) & ChrW(&H5C) & ChrW(&H30) & ChrW(&H2E) & ChrW(&H6A) & ChrW(&H70) & ChrW(&H67) & ChrW(&H0)
        AxGdViewer1.DisplayFromFile(file2) '// ng
    End Sub
End Class


Filename having Unicode &h30DE is okay, but having &h30E0 could not find the file...

May I have code of handling unicode path?
I can solve this problem maybe.
or give me version 4.12.3... T-T
leiqunni
 
Posts: 11
Joined: Fri Jan 11, 2008 11:44 am

Re: Unicode path handling

Postby leiqunni » Fri Oct 08, 2010 12:08 am

hi, long time no see you.
finally I could not solve this problem.
so now I use this code (C++ Builder XE)

Code: Select all
int __fastcall TForm1::DisplayFromFile(TGdViewer *object, String sFilePath)
{
   TFileStream *fs = new TFileStream(sFilePath, fmOpenRead);
   char *buf = new char[fs->Size];
   fs->Read(buf, fs->Size);
   long g =  fs->Size;
   int rtn = object->DisplayFromMemory((long)buf, &g);
   fs->Free();
   delete [] buf;
   return rtn;
}


I examined other SDK due to this probrem,
but GdPicture is best for my project.

see ya~
leiqunni
 
Posts: 11
Joined: Fri Jan 11, 2008 11:44 am


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest