Coder Social home page Coder Social logo

Comments (3)

SteffenL avatar SteffenL commented on May 25, 2024

Encoding issues

I'm not currently seeing the encoding issues.

I modified the basic example for C like this:

--- basic.c     2023-11-29 15:56:19.810600600 +0900
+++ basic.new.c 2023-11-29 15:52:09.401328600 +0900
@@ -16,9 +16,9 @@
 int main() {
 #endif
   webview_t w = webview_create(0, NULL);
-  webview_set_title(w, "Basic Example");
+  webview_set_title(w, "こんにちは, 你好, 안녕하세요, привет");
   webview_set_size(w, 480, 320, WEBVIEW_HINT_NONE);
-  webview_set_html(w, "Thanks for using webview!");
+  webview_set_html(w, "こんにちは, 你好, 안녕하세요, привет");
   webview_run(w);
   webview_destroy(w);
   return 0;

image

Can you provide an example to demonstrate the encoding problem?

I tested this on Windows 10 (compiled with GCC 8.3).

from webview.

SteffenL avatar SteffenL commented on May 25, 2024

Window initialization problem

Is this code a good example for showing the problem?

#include "webview.h"
#include <stddef.h>

#include <windows.h>

LRESULT lpfnWndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
  switch (msg) {
  case WM_CLOSE:
    PostQuitMessage(0);
    break;
  default:
    return DefWindowProcW(hwnd, msg, wp, lp);
  }
  return 0;
}

int main() {
  HINSTANCE hInstance = GetModuleHandle(0);

  WNDCLASSEXW wc;
  ZeroMemory(&wc, sizeof(WNDCLASSEX));
  wc.cbSize = sizeof(WNDCLASSEX);
  wc.hInstance = hInstance;
  wc.lpszClassName = L"app_window";
  wc.lpfnWndProc = lpfnWndProc;
  RegisterClassExW(&wc);

  HWND window = CreateWindowW(L"app_window", L"", WS_OVERLAPPEDWINDOW, 100, 100,
                              480, 320, NULL, NULL, hInstance, NULL);

  ShowWindow(window, SW_SHOW);
  UpdateWindow(window);

  webview_t w = webview_create(0, &window);
  webview_set_title(w, "Example");
  //webview_set_size(w, 480, 320, WEBVIEW_HINT_NONE); // Problem in screenshot exists with and without this line
  webview_set_html(w, "Hello");
  webview_run(w);
  webview_destroy(w);
}

image

from webview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.