Hi living in Denmark I’m forced to live with 3 special characters æøå.
It works fine in my JUCE apps while I stay at my Ubuntu machine.
My editor stores the danish charaters in UTF8 (my LANG=da_DK.utf8) Dump of my source file using hd (hexdump) file shows e.g ‘æ’ as the 2 bytes 0xc3 0xa6.
A few days ago I tryed compiling an application for windows. Here danish characters don’t show properly.
E.g. ‘æ’ is shown like the two characters ‘Ã|’
Question is what can I do in JUCE to get around this problem. Seing my source code in Visual Studion at Windows, danish characters are shown correctly.
I’ve here added a minor example showing an app having the problem:
/* ==============================================================================
* Demonstrating problems with DK chars in JUCE
* ==============================================================================
*/
#include "includes.h"
class MainComponent : public Component,
public ButtonListener
{
public:
//==============================================================================
MainComponent () : dkCharLabel (0),quitButton (0) {
addAndMakeVisible (dkCharLabel = new Label (String::empty,T("Dk chars (6 chars): >æøåÆØÅ<")));
addAndMakeVisible (quitButton = new TextButton (String::empty));
quitButton->setButtonText (T("Quit: æøåÆØÅ"));
quitButton->addButtonListener (this);
setSize (600, 300);
}
~MainComponent() {
deleteAndZero (dkCharLabel);
}
void paint (Graphics& g){}
void resized() {
dkCharLabel->setBounds (152, 80, 296, 48);
quitButton->setBounds (getWidth() - 176, getHeight() - 60, 120, 32);
}
void buttonClicked (Button* buttonThatWasClicked) {
if (buttonThatWasClicked == quitButton)
{
JUCEApplication::quit();
}
}
juce_UseDebuggingNewOperator
private:
Label* dkCharLabel;
TextButton* quitButton;
MainComponent (const MainComponent&);
const MainComponent& operator= (const MainComponent&);
};
class DkCharTestWindow : public DocumentWindow
{
public:
//==============================================================================
DkCharTestWindow()
: DocumentWindow (T("DK Char Test >æøåÆØÅ<"),
Colours::lightgrey,
DocumentWindow::allButtons,
true)
{
MainComponent* const contentComponent = new MainComponent();
setContentComponent (contentComponent, true, true);
centreWithSize (getWidth(), getHeight());
setVisible (true);
}
~DkCharTestWindow() {}
//==============================================================================
void closeButtonPressed()
{
JUCEApplication::quit();
}
};
class DkCharTestApplication : public JUCEApplication
{
DkCharTestWindow* dkCharTestWindow;
public:
DkCharTestApplication() : dkCharTestWindow (0) {}
~DkCharTestApplication() {}
void initialise (const String& commandLine)
{
dkCharTestWindow = new DkCharTestWindow();
}
void shutdown()
{
if (dkCharTestWindow != 0) delete dkCharTestWindow;
}
//==============================================================================
const String getApplicationName() {return T("Dk Char Test"); }
const String getApplicationVersion() {return T("1.0"); }
bool moreThanOneInstanceAllowed() {return true; }
void anotherInstanceStarted (const String& commandLine) {}
};
START_JUCE_APPLICATION (DkCharTestApplication)