Import dbase via Basic - how to select character set

I am trying to programmatically open a dbase (.dbf) file using Basic. It opens fine, but because the file has Chinese characters, it’s not displaying the Chinese characters correctly. When I try to open the dbase file manually with Calc, the “Import Dbase files” dialog pops up and asks for the Character set. If I then select “Big5”, the file opens and displays Chinese characters correctly.

So my question is: how to open the dbase file using Basic with Character set “Big5”? I have tried the following for my code, but I am not sure what I should set as the value of the FilterOptions.

Dim aDocProps(2) As New com.sun.star.beans.PropertyValue
Dim oDoc as Object

aDocProps(0).Name = "Hidden"
aDocProps(0).Value = False
aDocProps(1).Name  = "FilterName"
aDocProps(1).Value = "dBase"
aDocProps(2).Name  = "FilterOptions"
aDocProps(2).Value = 1

oDoc = StarDesktop.LoadComponentFromUrl(ConvertToURL("my.dbf"), "_blank", 0, aDocProps)

I am using LO 5.3.7.2 x64

Locale: zh-TW (zh_TW)

In the “Options - Language Settings - Languages”:

  • Locale setting: Default - Chinese (traditional)
  • Western: Default - English (USA)
  • Asian: Default - Chinese (traditional)

Thanks!

For Big5 try "68" (note that the option’s value is of type string), see Filter Options in old OOo wiki

1 Like

Thank you so much, that did the trick! I was looking for a page like this, but didn’t turn up on the search… I really need to work on my searching skills.