Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » LoadFile problem with accented chars
Re: LoadFile problem with accented chars [message #20033 is a reply to message #20032] Wed, 11 February 2009 15:25 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
s = ToUtf8(s.Mid(2).ToWString());

Well by looking at this code from the old version, I believe you should be getting the results you were getting (the wrong ones).

When calling ToWString, the input will be considered to be in Utf8, but you have an Utf16 stuffed inside an String (Utf8). That explains the extra zeros.

On the other hand, the new versions may work, but they are a little heavy on conversions and allocations so I wouldn't use them on large files. Especially for Utf8 BOM, I believe the solution would be to create a LoadFile which detects the BOM and allocates and fills a buffer/String without the BOM directly. I'll have to check out LoadFile before I can elaborate on this.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Core package build flags
Next Topic: Hi! Performance question
Goto Forum:
  


Current Time: Sun Aug 17 02:02:42 CEST 2025

Total time taken to generate the page: 0.05274 seconds