Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #13616 > unrolled thread

Romania characters file open

Started bydanijel koprivnjak <danijel.koprivnjak@gmail.com>
First post2022-08-01 03:26 -0700
Last post2022-08-03 18:39 -0700
Articles 4 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Romania characters file open danijel koprivnjak <danijel.koprivnjak@gmail.com> - 2022-08-01 03:26 -0700
    Re: Romania characters file open dlzc <dlzc1@cox.net> - 2022-08-01 08:39 -0700
    Re: Romania characters file open Jamal <nospam@example.com> - 2022-08-02 01:54 -0400
      Re: Romania characters file open Phil McGuinness <mcguinnesssherlock@gmail.com> - 2022-08-03 18:39 -0700

#13616 — Romania characters file open

Fromdanijel koprivnjak <danijel.koprivnjak@gmail.com>
Date2022-08-01 03:26 -0700
SubjectRomania characters file open
Message-ID<c81443f5-4144-4385-9ab2-2a7f5382a5a4n@googlegroups.com>
Hi,
I have a request to check Romanian files (txt files),
but I have big problems with the Romanian code page
When I open the file, I can't get two characters, I can't read characters ş and ț
cBuffer := MemAlloc(F_BLOCK)
IF cBuffer = NULL_PTR
	RETURN FALSE
ENDIF
nHandleImport:=FOpen2(cImportFile,FO_READ+FO_EXCLUSIVE,NULL_STRING)
nHandleCheck :=FCreate( cExportFile,FC_NORMAL	)
FRead4(nHandleImport, cBuffer, F_BLOCK,FALSE)
FWrite4(nHandleCheck, cBuffer,PszLen(cBuffer), FALSE)

FClose(nHandleImport)
MemFree(cBuffer)

I open the file, read it, save it and I have difference in the header and of course I don't get the above characters.

Any idea ?
many thx
Best
Danijel

[toc] | [next] | [standalone]


#13617

Fromdlzc <dlzc1@cox.net>
Date2022-08-01 08:39 -0700
Message-ID<41e4f4c6-e556-436d-81b1-1c4b81e391een@googlegroups.com>
In reply to#13616
On Monday, August 1, 2022 at 3:26:48 AM UTC-7, danijel.k...@gmail.com wrote:
> Hi, 
> I have a request to check Romanian files (txt files), 
> but I have big problems with the Romanian code page 
> When I open the file, I can't get two characters, I can't read characters ş and ț 
> cBuffer := MemAlloc(F_BLOCK) 
> IF cBuffer = NULL_PTR 
> RETURN FALSE 
> ENDIF 
> nHandleImport:=FOpen2(cImportFile,FO_READ+FO_EXCLUSIVE,NULL_STRING) 
> nHandleCheck :=FCreate( cExportFile,FC_NORMAL ) 
> FRead4(nHandleImport, cBuffer, F_BLOCK,FALSE) 
> FWrite4(nHandleCheck, cBuffer,PszLen(cBuffer), FALSE) 
> 
> FClose(nHandleImport) 
> MemFree(cBuffer) 
> 
> I open the file, read it, save it and I have difference in the header and of course
> I don't get the above characters. 
> 
> Any idea ? 

* I don't see a FClose operation nHandleCheck.

* Your aren't saying if the problem is in "file name" or "file contents".

* What is the size of cBuffer, right after you create it?

* I don't recognize the syntax FRead4 and FWrite4... are these built-ins or home-rolled?

* What character sets does PszLen recognize?  Any options that do not require null terminated (assuming) strings?

Places I'd suggest you look.

David A. Smith

[toc] | [prev] | [next] | [standalone]


#13618

FromJamal <nospam@example.com>
Date2022-08-02 01:54 -0400
Message-ID<tcae6q$9hs$1@gioia.aioe.org>
In reply to#13616
Hi Danijel,

This is possibly due to the OEM to ANSI conversion since you are passing 
FALSE in the 4th parameter of the FRead4() function. Try passing TRUE:

  FRead4(nHandleImport, cBuffer, F_BLOCK, TRUE)

The same goes for FWrite4().


You may also try using FReadLine() which is not dependent upon the 
status of SetAnsi().  From the VO documentation:

Sample:

ptrHandle := FOpen2("docs.txt", FO_READ)

IF ptrHandle != F_ERROR

  DO WHILE !FEOF(ptrHandle)

          ? FReadLine(ptrHandle)

  ENDDO

ENDIF

FClose(ptrHandle)


Jamal

On 8/1/2022 6:26 AM, danijel koprivnjak wrote:
> Hi,
> I have a request to check Romanian files (txt files),
> but I have big problems with the Romanian code page
> When I open the file, I can't get two characters, I can't read characters ş and ț
> cBuffer := MemAlloc(F_BLOCK)
> IF cBuffer = NULL_PTR
> 	RETURN FALSE
> ENDIF
> nHandleImport:=FOpen2(cImportFile,FO_READ+FO_EXCLUSIVE,NULL_STRING)
> nHandleCheck :=FCreate( cExportFile,FC_NORMAL	)
> FRead4(nHandleImport, cBuffer, F_BLOCK,FALSE)
> FWrite4(nHandleCheck, cBuffer,PszLen(cBuffer), FALSE)
> 
> FClose(nHandleImport)
> MemFree(cBuffer)
> 
> I open the file, read it, save it and I have difference in the header and of course I don't get the above characters.
> 
> Any idea ?
> many thx
> Best
> Danijel

[toc] | [prev] | [next] | [standalone]


#13619

FromPhil McGuinness <mcguinnesssherlock@gmail.com>
Date2022-08-03 18:39 -0700
Message-ID<421f4a7d-c2ba-477a-ad09-2f5225e433f6n@googlegroups.com>
In reply to#13618
On Tuesday, August 2, 2022 at 3:54:38 PM UTC+10, Jamal wrote:
> Hi Danijel, 

Trie setting ;

 	SetAnsi(TRUE) 	// DO NOT Remove required for correct CHR values  EOM to ANSI elsc CSV contain UTF8/OEM chars

Before processing the file.

Phil

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web