Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
  Before Logging a Support Issue in the Forum, please ensure you have:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
Save the new Output to a Text File and....
  • Attach it to your post
  • 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
      HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
     
    Page Index Toggle Pages: 1
    Send Topic Print
    VM not support chinese print, but arduino 1.8 is ok! (Read 231 times)
    Teeyacool
    Junior Member
    **
    Offline



    Posts: 7
    VM not support chinese print, but arduino 1.8 is ok!
    Jan 5th, 2019 at 6:21am
     
    Same code runs different result: VM can't show chinese, arduino work well.
    Here is part of the code.
    Code (C++):
    #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
     
    Visual Micro
    Administrator
    *****
    Offline



    Posts: 9678
    United Kingdom
    Re: VM not support chinese print, but arduino 1.8 is ok!
    Reply #1 - Jan 5th, 2019 at 5:35pm
     
    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
    Junior Member
    **
    Offline



    Posts: 7
    Re: VM not support chinese print, but arduino 1.8 is ok!
    Reply #2 - Jan 7th, 2019 at 1:29am
     
    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
     
    Visual Micro
    Administrator
    *****
    Offline



    Posts: 9678
    United Kingdom
    Re: VM not support chinese print, but arduino 1.8 is ok!
    Reply #3 - Jan 7th, 2019 at 1:13pm
     
    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 Topic Print