preview report got error when Windows User name Chinese word

Post Reply
User avatar
richard-service
Posts: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
Contact:

preview report got error when Windows User name Chinese word

Post by richard-service »

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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

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

Post by nageswaragunupudi »

Have you included this code in your main program?

Code: Select all | Expand

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
richard-service
Posts: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
Contact:

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

Post by richard-service »

nageswaragunupudi wrote:Have you included this code in your main program?

Code: Select all | Expand

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

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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

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

Post by nageswaragunupudi »

I see.
We will check.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

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

Post by nageswaragunupudi »

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
richard-service
Posts: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
Contact:

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

Post by richard-service »

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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

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

Post by nageswaragunupudi »

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: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

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

Post by nageswaragunupudi »

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

   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

    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
richard-service
Posts: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
Contact:

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

Post by richard-service »

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

   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

    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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

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

Post by nageswaragunupudi »

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

G. N. Rao.
Hyderabad, India
User avatar
richard-service
Posts: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
Contact:

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

Post by richard-service »

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
Post Reply