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 » UTF8 and accented characters
UTF8 and accented characters [message #20613] Thu, 26 March 2009 21:51 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

in the past I have signaled a problem in misaligned characters in a simple text file in which there were accented characters. It looked like this below:

index.php?t=getfile&id=1661&private=0

In principle there is a shift toward the left for each accented character. It seems there is a "eated" space for each accented character.

Today I have a simple test case that produces another problem that maybe related with the previous one.

#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{       String a = "ultimatepp ultimatepp ultimatepp\n";
	a << "ultimatèpp ultimatèpp ultimatèpp\n";
	SaveFile("a.txt", a);
}


This is what I see if in Project/Package organizer I set ENCODING=Default

index.php?t=getfile&id=1659&private=0

If instead I set ENCODING=UTF8 I get the problem with accented characters:

index.php?t=getfile&id=1660&private=0
Does not help to have as first line the command

SetDefaultCharset(CHARSET_UTF8);

Is it normal? Of course I am missing something... but what?
Thanks,
Luigi
  • Attachment: text2.jpg
    (Size: 4.59KB, Downloaded 784 times)
  • Attachment: text1.jpg
    (Size: 4.88KB, Downloaded 730 times)
  • Attachment: text3.jpg
    (Size: 12.38KB, Downloaded 375 times)
Re: UTF8 and accented characters [message #20616 is a reply to message #20613] Fri, 27 March 2009 08:56 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Thu, 26 March 2009 16:51


Is it normal? Of course I am missing something... but what?
Thanks,
Luigi



IMO:

You must always consider that there are two encodings involved:

Encoding that TheIDE uses to edit the file (that is in defined in Project menu).

Encoding that your code things the file is in. (This is set by SetDefaultCharset mainly).

If there is no match, you can see those weird things Smile

Also, if you switch the encoding for some file, TheIDE does not reencode it. That is why you see weird things after switching to utf-8 - the file that is NOT in utf8 gets displayed as if it was...

But you can still convert the file to another encoding, using Project/Convert to encoding.

Mirek
Previous Topic: Possible bug/clarification only callback2 was changed for const Object*
Next Topic: C++ libraries
Goto Forum:
  


Current Time: Mon Apr 29 16:01:18 CEST 2024

Total time taken to generate the page: 0.02905 seconds