preview report got error when Windows User name Chinese word

preview report got error when Windows User name Chinese word

Postby richard-service » Tue Aug 29, 2023 4:21 am

Hi Mr.Rao

When Windows user name is English name, preview report work fine.
But Chinese name, not work and got error message below:

Image
Image
Image
Image
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: preview report got error when Windows User name Chinese word

Postby nageswaragunupudi » Tue Aug 29, 2023 8:18 am

Have you included this code in your main program?
Code: Select all  Expand view  RUN
HB_CDPSELECT( "UTF8" )

If not please include this and let is know if the problem is resolved
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: preview report got error when Windows User name Chinese word

Postby richard-service » Tue Aug 29, 2023 6:05 pm

nageswaragunupudi wrote:Have you included this code in your main program?
Code: Select all  Expand view  RUN
HB_CDPSELECT( "UTF8" )

If not please include this and let is know if the problem is resolved


Yes, I set it. but not work.

Code: Select all  Expand view  RUN

HB_LangSelect( "zh" )
HB_SetCodePage( "UTF8" )
HB_CDPSELECT( "UTF8" )

Fw_SetUnicode( .T. )
 
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: preview report got error when Windows User name Chinese word

Postby nageswaragunupudi » Tue Aug 29, 2023 6:29 pm

I see.
We will check.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: preview report got error when Windows User name Chinese word

Postby nageswaragunupudi » Wed Aug 30, 2023 4:43 am

This is happening because our metafile functions like create, open, etc are not supporting Unicode file path names.
These functions are now made Unicode compatible.
With this you will not face this problem from the next version of FWH2208 to be released.
For the present you need to bear with the problem.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: preview report got error when Windows User name Chinese word

Postby richard-service » Fri Sep 01, 2023 10:17 am

nageswaragunupudi wrote:This is happening because our metafile functions like create, open, etc are not supporting Unicode file path names.
These functions are now made Unicode compatible.
With this you will not face this problem from the next version of FWH2208 to be released.
For the present you need to bear with the problem.


Mr.Rao

so the next version to be released?
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: preview report got error when Windows User name Chinese word

Postby nageswaragunupudi » Fri Sep 01, 2023 12:12 pm

We are trying to release around the middle of September. May be, we call it FWH2309
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: preview report got error when Windows User name Chinese word

Postby nageswaragunupudi » Fri Sep 01, 2023 12:22 pm

Till then, if you like, you can make a small patch in printer.prg

Please see this code in METHOD new()

Code: Select all  Expand view  RUN
  if ! ::lMeta
      ::hDcOut = ::hDC
   else
      ::aMeta  = {}
      ::cDir   = GetEnv( "TEMP" )

      if Empty( ::cDir )
         ::cDir = GetEnv( "TMP" )
      endif

      if Right( ::cDir, 1 ) == "\"
         ::cDir = SubStr( ::cDir, 1, Len( ::cDir ) - 1 )
      endif

      if ! Empty( ::cDir )
         if ! lIsDir( ::cDir )
            ::cDir = GetWinDir()
         endif
      else
         ::cDir := GetWinDir()
      endif
   endif

   if ::lMeta .and. ( ( ::lUseHaruPDF .and. IsHaruLinked() ) .or. ::lNativeWord )
      ::aCallLog  := {}
   else

Please add one line between "endif" and "if ::lMeta"
like this:
Code: Select all  Expand view  RUN
   endif
   ::cDir := "<some directory in pure English>"  // <-- Insert here

   if ::lMeta .and. ........


You choose some existing directory name which is in English, where the user has rights to create files.
Do not include "\" at the end.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: preview report got error when Windows User name Chinese word

Postby richard-service » Sun Sep 03, 2023 2:29 am

nageswaragunupudi wrote:Till then, if you like, you can make a small patch in printer.prg

Please see this code in METHOD new()

Code: Select all  Expand view  RUN
  if ! ::lMeta
      ::hDcOut = ::hDC
   else
      ::aMeta  = {}
      ::cDir   = GetEnv( "TEMP" )

      if Empty( ::cDir )
         ::cDir = GetEnv( "TMP" )
      endif

      if Right( ::cDir, 1 ) == "\"
         ::cDir = SubStr( ::cDir, 1, Len( ::cDir ) - 1 )
      endif

      if ! Empty( ::cDir )
         if ! lIsDir( ::cDir )
            ::cDir = GetWinDir()
         endif
      else
         ::cDir := GetWinDir()
      endif
   endif

   if ::lMeta .and. ( ( ::lUseHaruPDF .and. IsHaruLinked() ) .or. ::lNativeWord )
      ::aCallLog  := {}
   else

Please add one line between "endif" and "if ::lMeta"
like this:
Code: Select all  Expand view  RUN
   endif
   ::cDir := "<some directory in pure English>"  // <-- Insert here

   if ::lMeta .and. ........


You choose some existing directory name which is in English, where the user has rights to create files.
Do not include "\" at the end.


Ok. I will try it later.
Thank you.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: preview report got error when Windows User name Chinese word

Postby nageswaragunupudi » Sun Sep 03, 2023 9:01 am

May I know your current FWH version?
Are you planning to upgrade?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: preview report got error when Windows User name Chinese word

Postby richard-service » Mon Sep 04, 2023 7:00 am

nageswaragunupudi wrote:May I know your current FWH version?
Are you planning to upgrade?


I am using FWH 22.12 Version.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests