MMAUG / flood-website

Web version of Myanmar Flood information
http://myanmarflood.info/
MIT License
7 stars 7 forks source link

Form submitting with unicode! #6

Closed greenlikeorange closed 9 years ago

greenlikeorange commented 9 years ago

Recently I added font converting middle-ware at data receiving form API. I will change all zawgyi formatted string to unicode5.1 standard.

But for form submitting, I left it as zawgyi because I not sure API accept unicode or not? If API accept both font, I will convert font-text to unicode5 before POST request send.

nyanlynnhtut commented 9 years ago

@alt332

yelinaung commented 9 years ago

Here's my 2¢.

The API should be able to accept both inputs but with detecting and converting to one font before inserting the data into the db. Since the existing data are in Zg, should we convert the Unicode content to Zg and inserted ? ( Damn, it breaks my heart to say that. I hope this is the last time I have to say "convert Unicode to Zg" :broken_heart: )

And for website which fetches the data from API, it is not that hard to change accordingly. It can continue with existing one because font embedding is Good Enough™.

However, for the app, it's a bit tricky as it might break the existing apps if the new app tends to use Unicode.

One solution is API can be either versioned for old one and new one. The question here is the old app still should receive the updated content in the format that old app can accept. Is that possible ?

Another solution is the API to provide the converted data whenever the new app calls the API with a flag.

Let's do this quickly.

yemyatthu1990 commented 9 years ago

+1 to @yelinaung solution

greenlikeorange commented 9 years ago

@yelinaung I think converting before send from API is not cheap. How about convert Unicode of current data and also receiving data from old app. That might be good i thought.

yelinaung commented 9 years ago

@alt332 @khzaw You guys might already know this. @trhura's paytan has the font detecting and converting ready for Python.

yelinaung commented 9 years ago

@greenlikeorange Yup. It's never cheap but right now, I am not even worry about it because do the app has 10 millions users ? Not an issue but I am just saying.

How about convert Unicode of current data and also receiving data from old app. That might be good i thought.

I would not go for it. The old app cannot receive Unicode contents and I do not think the new app tents to use Unicode.

greenlikeorange commented 9 years ago

@yelinaung ok, so you go for convert in coming data to zawgyi ? So should the new data from web be zawgyi?

yelinaung commented 9 years ago

Yes. That seems the easiest, dirtiest and fastest solution to implement.

So should the new data from web be zawgyi?

It's always been Zg. Isn't it ?

greenlikeorange commented 9 years ago

Yes, it will be zawgyi.

yelinaung commented 9 years ago

We shall leave the decision to the @khzaw and @alt332

khzaw commented 9 years ago

The data in the db would persist in unicode only. In fact, we will start pruning existing zg content in db into unicode. The clients should take the data and convert it accordingly.

That being said, if it is too much for the client to do on the fly conversion, the server could convert the content into zawgyi before serving it out via GET or saving it into it db. But data persistence will only be in unicode and unicode only.

cc @alt332

yelinaung commented 9 years ago

@khzaw Yayy. I love Unicode. So, the API will provide two versions of data ?

yelinaung commented 9 years ago

Please continue the discussion with @indexer @nyanlynnhtut @mmublackpirate @PoePoeMyintSwe since they are doing the Android app.

greenlikeorange commented 9 years ago

@alt332 API v2 က Unicode ဘဲလက်ခံတော့မှာလာ?

nyanlynnhtut commented 9 years ago

Ping @khzaw