Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set MSVC to use UTF-8 on source files #2346

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

drasticactions
Copy link
Contributor

Although the files in Whisper.cpp are encoded with UTF-8, MSVC seems to take the system's default text encoding into account when compiling.

https://github.com/ggerganov/whisper.cpp/blob/master/src/whisper.cpp#L4982C1-L4987C3

So when MSVC reencodes this into the system encoding (Ex. Shift-JIS), it blows up when compiling. We could change this to use Unicode escape characters, but if we set MSVC to treat all files as UTF-8, it should compile fine on all systems, regardless of the default encoding and whatever text is used here.

As far as I know, this should only affect compiling, and the build output should be the same.

@chinshou
Copy link

I can confirm that I have the same compile problem in a Japanese Windows.

@ggerganov ggerganov merged commit c96906d into ggerganov:master Aug 30, 2024
44 of 46 checks passed
ggerganov added a commit that referenced this pull request Sep 2, 2024
ggerganov added a commit that referenced this pull request Sep 2, 2024
bygreencn added a commit to bygreencn/whisper.cpp that referenced this pull request Sep 3, 2024
* ggerganov/master: (40 commits)
  revert : cmake : set MSVC to use UTF-8 on source files (ggerganov#2346)
  sync : ggml
  ggml: fix ggml_graph_cpy undefined behavior (ggml/943)
  cann : fix doxy (ggml/0)
  vulkan : fix build (llama/0)
  cuda : mark BF16 CONT as unsupported
  ggml : fix cont with transposed tensors when one dimension is 1 (ggml/934)
  cmake : set MSVC to use UTF-8 on source files (ggerganov#2346)
  readme : remove invalid flag from Python example (ggerganov#2396)
  readme : fix link (ggerganov#2394)
  go : add beamsize/entropythold/maxcontext to context interface (ggerganov#2350)
  talk-llama : sync llama.cpp
  whisper : update FA call
  sync : ggml
  sync : vulkan (skip) (llama/0)
  ggml : do not crash when quantizing q4_x_x with an imatrix (llama/9192)
  metal : separate scale and mask from QKT in FA kernel (llama/9189)
  ggml : add SSM Metal kernels (llama/8546)
  metal : gemma2 flash attention support (llama/9159)
  CPU/CUDA: Gemma 2 FlashAttention support (llama/8542)
  ...
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants