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

encoding #24

Open
thorade opened this issue May 25, 2018 · 8 comments · May be fixed by #28
Open

encoding #24

thorade opened this issue May 25, 2018 · 8 comments · May be fixed by #28

Comments

@thorade
Copy link

thorade commented May 25, 2018

When saving a table to a tex file, that file has ANSI encoding, so if the table contains e.g. ÄÖÜ I currently need to open the file in Notepad++ and convert to UTF-8. Would it be possible to either store the file as UTF-8 directly, or convert Ö to {"O} ??

I filed a similar issue years ago:
https://bugs.launchpad.net/excel2latex/+bug/944134
but the workaround used there does not work anymore, because I switched from pdflatex to lualatex.

Any ideas for a new workaround or solution?
By now all editors support UTF-8, and pdflates also supports utf8.

@ma-harvey
Copy link

I was facing the same issue and found a solution, simply by editing the saving function in the VBA editor.

Change the "SaveConversionResultToFile" as follows:

`Public Sub SaveConversionResultToFile(ByVal pModel As IModel)
Dim sFileName As String
sFileName = pModel.AbsoluteFileName
If sFileName = "" Then Exit Sub

Dim fsT As Object
Set fsT = CreateObject("ADODB.Stream")
fsT.Type = 2 'Specify stream type - we want To save text/string data.
fsT.Charset = "utf-8" 'Specify charset For the source text data.
fsT.Open 'Open the stream And write binary data To the object
fsT.WriteText pModel.GetConversionResult
fsT.SaveToFile sFileName, 2 'Save binary data To disk

End Sub`

The result is that the file generated will be UTF-8 directly

@thorade
Copy link
Author

thorade commented Nov 15, 2018

Nice! Could you submit that as a Pull Request?
And in the text, reference this issue as #24?

@ma-harvey
Copy link

I'm not so familiar with GitHub mechanics.

But feel free to post it.

@ivankokan ivankokan linked a pull request Jan 18, 2019 that will close this issue
@ivankokan
Copy link
Owner

@thorade Until PR gets accepted, you can use "Copy to Clipboard", right?

@thorade
Copy link
Author

thorade commented Jan 18, 2019

OK, thanks, will try that.
ADOB.Streams does not work on Mac, it seems.
What platforms did you test your PR on?

@ivankokan
Copy link
Owner

ivankokan commented Jan 18, 2019

Windows 7, Office 365.
Try to contribute for Mac :), maybe this will help: http://talesoftech.blogspot.com/2011/05/excel-on-mac-goodbye-vba-hello.html.

@ivankokan
Copy link
Owner

ivankokan commented Jan 18, 2019

@thorade, if you are able to test #28 on Mac, can you please describe the behavior? Which error you exactly get (assuming that ADODB.Stream is not supported)? I would like to handle errors in that case, at least saying "This feature is not (yet) supported on Mac".

@ivankokan
Copy link
Owner

Hi @thorade, I am about to implement Unicode -> UTF-8 encoder on my own so it's platform independent. Stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants