Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem reading fields from dbf created with SetAnsi == FALSE #1449

Closed
cpyrgas opened this issue Apr 11, 2024 · 1 comment
Closed

Problem reading fields from dbf created with SetAnsi == FALSE #1449

cpyrgas opened this issue Apr 11, 2024 · 1 comment
Assignees
Projects
Milestone

Comments

@cpyrgas
Copy link

cpyrgas commented Apr 11, 2024

https://www.xsharp.eu/forum/topic?p=29347#p29347

Create a dbf with SetAnsi(FALSE) in VO, with this code:

FUNCTION Start()  AS INT
	LOCAL cDbf AS STRING
	
	SetAnsi(FALSE)
	
	cDbf := "C:\dbf\testansi"
	DbCreate(cDbf,{{"TXT","C",20,0}})
	
	SetAnsi(FALSE)
	
	DbUseArea(,,cDbf)
	DbAppend();FieldPut(1,"öÖäÄ")
	? FieldGet(1)
	? AllTrim(FieldGet(1)) == "öÖäÄ" // true 
	DbCloseArea()
	
	SetAnsi(TRUE)
	
	DbUseArea(TRUE,,cDbf)
	? FieldGet(1)
	? AllTrim(FieldGet(1)) == "öÖäÄ" // false 
	DbCloseArea()
	
	WAIT
RETURN 0

Now try opening it in X#, with similar code, again using SetAnsi(FALSE), umlautes are not being read correctly:

FUNCTION Start() AS VOID
	LOCAL cDbf AS STRING
	cDbf := "C:\dbf\testansi"
	
	SetAnsi(FALSE)

	DbUseArea(TRUE,,cDbf)
	? FieldGet(1)
	? AllTrim(FieldGet(1)) == "öÖäÄ" // FALSE, wrong
	DbCloseArea()

	SetAnsi(TRUE)

	DbUseArea(TRUE,,cDbf)
	? FieldGet(1)
	? AllTrim(FieldGet(1)) == "öÖäÄ" // FALSE, OK
	DbCloseArea()

@RobertvanderHulst RobertvanderHulst self-assigned this Apr 11, 2024
@RobertvanderHulst RobertvanderHulst added this to To Do in Build 2.20 via automation Apr 11, 2024
@RobertvanderHulst RobertvanderHulst moved this from To Do to Needs Testing in Build 2.20 Apr 11, 2024
@cpyrgas cpyrgas added this to the 2.x milestone Apr 12, 2024
@cpyrgas
Copy link
Author

cpyrgas commented Apr 12, 2024

Confirmed fixed

@cpyrgas cpyrgas closed this as completed Apr 12, 2024
@cpyrgas cpyrgas moved this from Needs Testing to Done in Build 2.20 Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants