Classical Numismatics Discussion
  Welcome Guest. Please login or register. 10% Off Store-Wide Sale Until 2 April!!! Explore Our Website And Find Joy In The History, Numismatics, Art, Mythology, And Geography Of Coins!!! Expert Authentication - Accurate Descriptions - Reasonable Prices - Coins From Under $10 To Museum Quality Rarities Welcome Guest. Please login or register. 10% Off Store-Wide Sale Until 2 April!!! Explore Our Website And Find Joy In The History, Numismatics, Art, Mythology, And Geography Of Coins!!! Support Our Efforts To Serve The Classical Numismatics Community - Shop At Forum Ancient Coins

New & Reduced


Author Topic: Editing Metatags with Japanese Text Without Damaging Pages  (Read 4629 times)

0 Members and 1 Guest are viewing this topic.

Offline Joe Sermarini

  • Owner, President
  • FORVM STAFF
  • Caesar
  • *****
  • Posts: 12102
  • All Coins Guaranteed for Eternity.
    • FORVM ANCIENT COINS
Editing Metatags with Japanese Text Without Damaging Pages
« on: March 27, 2020, 04:10:43 pm »
I need to add the viewport tag on a hosted website (a tag required for mobile usability).  If I try to add the tag with ordinary English language (Latin alphabet) editor (I have tried a few), the Japanese characters are removed and replaced with garbage. Does anyone know how I can add the metatag without ruining the pages?
Joseph Sermarini
Owner, President
FORVM ANCIENT COINS

Offline xanthos

  • Praetorian
  • **
  • Posts: 24
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #1 on: March 27, 2020, 04:57:00 pm »
The page has Japanese letters that break when you add the viewport tag with your editor? Sounds like your editor is messing up the encoding of the page. What editors have you tried? And what page is it?

Offline Joe Sermarini

  • Owner, President
  • FORVM STAFF
  • Caesar
  • *****
  • Posts: 12102
  • All Coins Guaranteed for Eternity.
    • FORVM ANCIENT COINS
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #2 on: March 27, 2020, 08:12:08 pm »
I have used simple text editors, like notepad.  Yes, it is messing up the encoding of Chinese characters (the same problem also applies to Greek and other alphabets).  The pages are here:

https://www.forumancientcoins.com/augustus/index.html
Joseph Sermarini
Owner, President
FORVM ANCIENT COINS

Offline xanthos

  • Praetorian
  • **
  • Posts: 24
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #3 on: March 28, 2020, 03:42:15 am »
If you're looking at the HTML code of the page, you will see that it uses Shift_JIS as encoding. Notepad only supports ANSI and some UTF encodings. So you will either need an editor that supports this Japanese encoding or you will have to convert the file from Shift_JIS to UTF-8 (and don't forget to change the content type meta tag).

Offline Joe Sermarini

  • Owner, President
  • FORVM STAFF
  • Caesar
  • *****
  • Posts: 12102
  • All Coins Guaranteed for Eternity.
    • FORVM ANCIENT COINS
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #4 on: March 28, 2020, 06:59:16 am »
Does anyone know a free editor that uses Shift_JIS encoding and works in English?
Joseph Sermarini
Owner, President
FORVM ANCIENT COINS

Offline PeterD

  • Procurator Caesaris
  • Caesar
  • ****
  • Posts: 1483
  • omnium curiositatum explorator
    • Historia
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #5 on: April 08, 2020, 09:52:01 am »
Notepad is absolutely fine for editing HTML pages. It uses plain text only, which is all that is needed. No need to insert Japanese or any other characters. Just leave the original tags as they were.
Peter, London

Historia: A collection of coins with their historical context https://www.forumancientcoins.com/historia

Offline Joe Sermarini

  • Owner, President
  • FORVM STAFF
  • Caesar
  • *****
  • Posts: 12102
  • All Coins Guaranteed for Eternity.
    • FORVM ANCIENT COINS
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #6 on: April 08, 2020, 11:50:59 am »
Thanks, but you have misunderstood the problem.  I am attempting to add a metatag to a page that has Japanese content. I don't want to insert Japanese, the page is already in Japanese. Notepad does not recognize the Japanese characters and turns them into scrambled nothing.  Notepad destroys the content of the page.
Joseph Sermarini
Owner, President
FORVM ANCIENT COINS

Offline PeterD

  • Procurator Caesaris
  • Caesar
  • ****
  • Posts: 1483
  • omnium curiositatum explorator
    • Historia
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #7 on: April 08, 2020, 01:32:25 pm »
What I don't understand, is why you want a text editor that uses 'Shift_JIS' coding. An HTML page is just plain text. You can open it in Notepad. There won't be any Japanese there, just tags. So add the line you want and save it (still as .html). Open in a browser and it should display as before.
Peter, London

Historia: A collection of coins with their historical context https://www.forumancientcoins.com/historia

Offline Joe Sermarini

  • Owner, President
  • FORVM STAFF
  • Caesar
  • *****
  • Posts: 12102
  • All Coins Guaranteed for Eternity.
    • FORVM ANCIENT COINS
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #8 on: April 08, 2020, 01:51:14 pm »
No, notepad does not work. The page below was Japanese text. After changing the metatag IN NOTEPAD and saving, it looks like this. By the way, it will do the same to Greek, Russian or any other text that is not in the Latin alphabet.
Joseph Sermarini
Owner, President
FORVM ANCIENT COINS

Offline PeterD

  • Procurator Caesaris
  • Caesar
  • ****
  • Posts: 1483
  • omnium curiositatum explorator
    • Historia
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #9 on: April 08, 2020, 06:27:28 pm »
Yes, I can see it doesn't work. When you try out the edited HTML page in a browser, is the page 'in situ'? -in other words, not a copy on your HD. Could be  there is separate font information that cannot be accessed.

You say that greek is similarly affected. However, many of my Historia pages have greek on them and they all work (on computer or smartphone) even though you have added the 'Viewport' line to them. So the Greek you are looking at and the Japanese probably do access separate font information or the font native to viewing device.

Hope that helps.
Peter, London

Historia: A collection of coins with their historical context https://www.forumancientcoins.com/historia

Offline Meepzorp

  • IMPERATOR
  • Caesar
  • *****
  • Posts: 5127
    • Meepzorp's Ancient Coins
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #10 on: April 09, 2020, 12:45:59 am »
You say that greek is similarly affected. However, many of my Historia pages have greek on them and they all work (on computer or smartphone) even though you have added the 'Viewport' line to them. So the Greek you are looking at and the Japanese probably do access separate font information or the font native to viewing device.

Hi PD,

I am not a coding expert anymore. I used to be when I was younger (many decades ago). So, I don't know if this post will be useful to you and Joe.

Many of my website pages also have Greek letters. They display perfectly fine since Joe added that extra line of code to my pages.

Why are my pages and your pages displaying Greek letters perfectly fine, but Joe is having problems displaying Japanese and Greek letters in his pages that he mentioned at the beginning of this thread?

Maybe it has something to do with the line of code at the beginning of all of my website pages that contains "UFT-8"? I don't know. I think one of the earlier posters in this thread was alluding to that.

Again, I have been "out of the loop" regarding coding for so many years (several decades actually) that I am not sure.

Meepzorp

Offline PeterD

  • Procurator Caesaris
  • Caesar
  • ****
  • Posts: 1483
  • omnium curiositatum explorator
    • Historia
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #11 on: April 09, 2020, 07:15:33 am »
Hi Meepzorp

Your pages and mine use individual greek characters in the form Α That works fine for a small number of letters. I don't know the details but I guessing that if you need to put in a large amount of text and define a specific font (particularly for Japanese) you need to do something else (UTF-8, UTF-16?). I think that that would require a declaration as to where that font could be found. However, that shouldn't be of any concern. What I am saying is that if a page was, say, copied onto an office computer, the path to the font would then be wrong and opening the page would show garbled text. However, if the page was edited as required and then copied back to the server, it should work correctly.

PD
Peter, London

Historia: A collection of coins with their historical context https://www.forumancientcoins.com/historia

Offline Joe Sermarini

  • Owner, President
  • FORVM STAFF
  • Caesar
  • *****
  • Posts: 12102
  • All Coins Guaranteed for Eternity.
    • FORVM ANCIENT COINS
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #12 on: April 09, 2020, 08:28:33 am »
As xanthos said above, "Notepad only supports ANSI and some UTF encodings." When opening the page, Notepad warns that it is incompatible and the page is scrambled. If it is saved, it stays scrambled. It has nothing to do with native fonts or where the file is stored. I need an editor that supports this Japanese encoding.
Joseph Sermarini
Owner, President
FORVM ANCIENT COINS

Offline PeterD

  • Procurator Caesaris
  • Caesar
  • ****
  • Posts: 1483
  • omnium curiositatum explorator
    • Historia
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #13 on: April 09, 2020, 08:58:54 am »
I must say that I am mystified by what you are trying to do. An .html file is a simple text file. Whatever word editor you use, any foreign language text will just appear as disparate characters. Nothing gets changed unless you change it. The foreign language only appears when you run the file in a browser.

Perhaps you can give me the address of one of these Japanese or Greek pages and I can try it myself.
Peter, London

Historia: A collection of coins with their historical context https://www.forumancientcoins.com/historia

Offline Joe Sermarini

  • Owner, President
  • FORVM STAFF
  • Caesar
  • *****
  • Posts: 12102
  • All Coins Guaranteed for Eternity.
    • FORVM ANCIENT COINS
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #14 on: April 09, 2020, 10:12:36 am »
Peter, I am sorry but you are wrong.  I tried everything that you have suggested before I started this thread.

The Greek pages, I already replaced the incompatible code with compatible code. The incompatible Greek code was changed to question marks by notepad.

Here is the Japanese website: https://www.forumancientcoins.com/augustus/index.html. Right click and see the source. It is not simple text.
Joseph Sermarini
Owner, President
FORVM ANCIENT COINS

Offline PeterD

  • Procurator Caesaris
  • Caesar
  • ****
  • Posts: 1483
  • omnium curiositatum explorator
    • Historia
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #15 on: April 09, 2020, 11:55:59 am »
Now I understand the problem - if not the answer.

I did try editing the web page in Notepad. Viewed in Notepad, the Japanese was garbage as you would expect. However when I tried to view it in a browser, the Japanese script all seemed to be there. However, the page wasn't formatted, and all the tags were displayed. However the unedited page reacted in the same way.

I am now waving the white flag!
Peter, London

Historia: A collection of coins with their historical context https://www.forumancientcoins.com/historia

Offline helvetica

  • Tribuna Plebis Perpetua
  • Procurator Monetae
  • Caesar
  • *****
  • Posts: 1799
  • Helvetia Libera Deo Gratia
    • ID Help pages + RIC lists + www.wildwinds.com
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #16 on: June 08, 2020, 07:20:57 pm »
Did you get this sorted out, Joe ? When I use the link to the /augustus/ page it seems to have been removed (404 Not Found, or Internal Error).
I could see whether NoteTab Pro (NOT Notepad!) can do what you want.

Offline Joe Sermarini

  • Owner, President
  • FORVM STAFF
  • Caesar
  • *****
  • Posts: 12102
  • All Coins Guaranteed for Eternity.
    • FORVM ANCIENT COINS
Re: Editing Metatags with Japanese Text Without Damaging Pages
« Reply #17 on: June 09, 2020, 10:38:03 am »
No, I haven't sorted it out yet. I have temporarily dropped the project. Too many other things fell behind. 
Joseph Sermarini
Owner, President
FORVM ANCIENT COINS

 

All coins are guaranteed for eternity