I would like to distribute static HTML files in laravel 6.x series.
I am trying to use the public folder, but there is a problem.
Example)
public/hogeA/index.html←Shift_JIS
public/hogeB/index.html←UTF-8
public/hogeC/index.html←Shift_JIS
If Shift_JIS and UTF-8 files are mixed in index.html per folder as shown above,
In this example, the index.html of hogeA and hogeC is garbled when viewed in the browser.
If you look at the content-type of the response header of hogeA, you can see that the reason is text/html; charset=UTF-8.
Is there a way to force the content-type of the html Response Header below the specific folder in the public folder to charset=Shift_JIS?
html laravel character-code shift-jis
You can specify the META tag to return the appropriate encoding in the HTML file.
The following is an example of specifying UTF-8, but in the case of Shift_JIS, it seems to be "Shift_JIS".
reference:
Specify character encoding in HTML
<!DOCTYPE html>
<html lang="en">
<head>
<metacharset="utf-8"/>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
577 PHP ssh2_scp_send fails to send files as intended
599 GDB gets version error when attempting to debug with the Presense SDK (IDE)
567 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
572 Understanding How to Configure Google API Key
568 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.