In the past year I've really only used this blog for posting pictures and an occasional short update. However, I used to post on other topics, including some minor coding. One of those posts, creating a UTF-8 encoded file in Excel VBA, was THE most popular post I had. I'm re-posting it again - maybe it will help someone :)
So recently I've been working on a project that required a bit of research. It was NOT easy to find out this information, so I decided to post it here. The background for this story is that we're working with Hungarian text, and only UTF-8 (not Unicode) saves it properly. Also, I needed the text to be wrapped at 69 characters, with no orphans (or single words on a line). First things first, here's the code I used to save in UTF-8 (I didn't come up with this, but I don't know where I found it):
Not so difficult, right? If you have a better way to save as UTF-8, please let me know!
Now for the difficult part: wrapping text. I have some redundancy, I know, but there are some irritating things about split that doesn't make it easy to work with if there are double spaces, etc. Here's my final code:
Again, if you know a better way, please let me know! Thanks!
