Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic VM not support chinese print, but arduino 1.8 is ok! (Read 2025 times)
Teeyacool
Newbies
*
Offline


Posts: 7
Joined: Jan 5th, 2019
VM not support chinese print, but arduino 1.8 is ok!
Jan 5th, 2019 at 6:21am
Print Post  
Same code runs different result: VM can't show chinese, arduino work well.
Here is part of the code.
Code (C++)
Select All
#include <dummy.h>
#include <U8x8lib.h>
#include <Arduino.h>
#include <U8g2lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif

void setup(void) {
	Serial.begin(115200);
	u8g2.begin();
	u8g2.enableUTF8Print();    // enable UTF8 support for the Arduino print() function
	u8g2.setFont(u8g2_font_wqy16_t_gb2312);  // use chinese2 for all the glyphs of "你好世界"
	u8g2.setFontDirection(0);
	u8g2.setCursor(0, 15);
	u8g2.print("世界你好");    // Chinese "Hello World"
	u8g2.sendBuffer();
}
 

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM not support chinese print, but arduino 1.8 is ok!
Reply #1 - Jan 5th, 2019 at 5:35pm
Print Post  
This is because your code file has the wrong encoding for your purpose.

Click "File>Save As" then you will see the SAVE button has a "down arrow" menu that shows "Save with encoding". You can click a unicode option near the top of the list.

  
Back to top
WWW  
IP Logged
 
Teeyacool
Newbies
*
Offline


Posts: 7
Joined: Jan 5th, 2019
Re: VM not support chinese print, but arduino 1.8 is ok!
Reply #2 - Jan 7th, 2019 at 1:29am
Print Post  
Thanks a lot! 
    According your suggestion, I choose "save whit encoding", and set Unicode, it's show chinese now. Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM not support chinese print, but arduino 1.8 is ok!
Reply #3 - Jan 7th, 2019 at 1:13pm
Print Post  
Great, I will look at making new files unicode by default for future release
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint