1

We are exporting Lotus Notes documents to CSV file. Some of the field have Chinese characters in them. They are visible in Lotus Notes (though I don't understand them) but when we export them to CSV file they are converted to question marks. Below is the code snippet I am using for export:

fieldNames = Split("Field1,Field2,Field3,Field4", ",")

Set stream = session.CreateStream

If stream.Open(csvFileName) Then
    Call stream.Truncate()

    Forall f In fieldNames
        Call stream.WriteText("""" + doc.GetItemValue(f)(0) + """,")
    End Forall
    .....
    .....
    .....
End If

Here if the field Field1 contains Chinese characters and it is exported, they are converted to question marks. How to properly export Chinese characters?

Naveen
  • 6,786
  • 10
  • 37
  • 85

1 Answers1

3

Set a charset "UTF-16" for stream: stream.Open(csvFileName, "UTF-16") then it works for Chinese.

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • Thanks for the suggestion to use `charset` while opening stream. But it didn't work with UTF-8 or Big5. Instead it worked with "UTF-16". – Naveen May 09 '13 at 12:32
  • If you could update the answer to UTF-16 I would be glad to accept it. – Naveen May 09 '13 at 12:47