Giter Site home page Giter Site logo

Comments (9)

ichigotake avatar ichigotake commented on June 14, 2024

お酒が入ってる時の勢いで出したレポートなので不手際があると思います
お酒が抜け切った頃にまたレポートします…

from amon.

tokuhirom avatar tokuhirom commented on June 14, 2024

そろそろ抜けきったでしょうか?

from amon.

ichigotake avatar ichigotake commented on June 14, 2024

今日の仕事が終わって家に着いたらもう一度詳しく調べてみます

from amon.

ichigotake avatar ichigotake commented on June 14, 2024

追加で試した事

検証ブランチ: ichigotake/Amon@master...encode_test

結論から言うと、原因はわからず事象を確認するだけしか出来ませんでした


タイトルで示したように tmpl/index.tt に検証コードを書き加えたものをSetupスクリプトに含ませ、手元にインストールする

Setupに含めた デバッグプリント( warn $c->req->uri_with({page => 1}) )を見ると、正しいエンコードになっていた
=> 原因はテンプレートでの何か?

http://localhost:5000/?page=1&q=%E3%81%82 at /path/to/MyApp/lib/MyApp/Web/Dispatcher.pm line 12.

以下のいずれかを実行してから carton exec plackup するとエンコードが正しくなり、そのアプリケーションでは 二度と バグが再現しなくなる

$ touch .
$ touch app.psgi
$ touch local
$ touch lib
$ cp /other/path/app.psgi app.psgi  # 中身が全く同じもので上書き
### *touch* に限らず、*vim* でファイルを開いて何も編集せずに上書き保存をするだけでも同等の効果が得られる

$ carton exec plackup #再起動してもエンコードが正しくなる

### tmpl/ は何かしらの操作を加えても影響なし

まとめ

  • cpanmcarton install のみでデプロイしたものをplackupするとuri_with()で化けるが、何かしらの操作を行った後に plackup すると二度とバグが再現しなくなる

ものは試しと、Amon2::Web::Requestに use utf8 を書き加えてみましたが、変わらず。
(flagged utf8についてよくわかっていないのでこれは当てずっぽうな検証ですが…)

from amon.

tokuhirom avatar tokuhirom commented on June 14, 2024

ちょっとためすのむずかしくてお返事がおそくなりましてすみません。
こちら調査の結果、Xslate のバグであると断定し、@gfx に報告いたしました。
xslate/p5-Text-Xslate#82

ですので、そのうちなおるかとおもいます。

from amon.

ichigotake avatar ichigotake commented on June 14, 2024

はい、ありがとうございます

from amon.

gfx avatar gfx commented on June 14, 2024

Xslate 2.0008で修正しました‥が、この問題が自然消滅する方向での修正ではないかもしれません。

具体的には、テンプレート文字列内の文字列リテラルはすべて Text::Xslate->new(input_layer => '":encoding(utf8)") の影響下ではUTF8フラグが付くようになりました。これがもともと初回起動時や cache => 0 時の挙動でしたので。

from amon.

tokuhirom avatar tokuhirom commented on June 14, 2024

だいぶおそくなってしまいましたが、修正しました。

from amon.

ichigotake avatar ichigotake commented on June 14, 2024

すっかり忘れてしまっていました
修正ありがとうございます

from amon.

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.