FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour preview report got error when Windows User name Chinese word
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
preview report got error when Windows User name Chinese word
Posted: Tue Aug 29, 2023 04: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:




Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: preview report got error when Windows User name Chinese word
Posted: Tue Aug 29, 2023 08:18 AM
Have you included this code in your main program?
Code (fw): Select all Collapse
HB_CDPSELECT( "UTF8" )
If not please include this and let is know if the problem is resolved
Regards



G. N. Rao.

Hyderabad, India
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: preview report got error when Windows User name Chinese word
Posted: Tue Aug 29, 2023 06:05 PM
nageswaragunupudi wrote:Have you included this code in your main program?
Code (fw): Select all Collapse
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 (fw): Select all Collapse
HB_LangSelect( "zh" )
HB_SetCodePage( "UTF8" )
HB_CDPSELECT( "UTF8" )

Fw_SetUnicode( .T. )
Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: preview report got error when Windows User name Chinese word
Posted: Tue Aug 29, 2023 06:29 PM

I see.

We will check.

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: preview report got error when Windows User name Chinese word
Posted: Wed Aug 30, 2023 04: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
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: preview report got error when Windows User name Chinese word
Posted: 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 (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: preview report got error when Windows User name Chinese word
Posted: 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: preview report got error when Windows User name Chinese word
Posted: 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 (fw): Select all Collapse
   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 (fw): Select all Collapse
    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
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: preview report got error when Windows User name Chinese word
Posted: Sun Sep 03, 2023 02: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 (fw): Select all Collapse
   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 (fw): Select all Collapse
    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 (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: preview report got error when Windows User name Chinese word
Posted: Sun Sep 03, 2023 09:01 AM

May I know your current FWH version?

Are you planning to upgrade?

Regards



G. N. Rao.

Hyderabad, India
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: preview report got error when Windows User name Chinese word
Posted: Mon Sep 04, 2023 07: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 (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit

Continue the discussion