两个URL编码字符串之间的Java差异(Java difference between two URL Encoded strings)
以下两个编码字符串有什么区别?
%D0%9E%D0%BA%D0%B6%D1%8D%D0%B7
和
%26%231055%3B%26%231088%3B%26%231080%3B%26%231074%3B%26%231077%3B%26%231090%3B
我正在尝试URL将俄文文本“Привет”编码为上面的第二个编码字符串( W3Schools编码器正确),但是我使用的URL编码器不断给我上面的第一个编码字符串。 我正在使用来自W3联盟的URLUTF8Encoder.java 。 我必须使用这个,因为我正在开发一个需要J2ME的移动平台。
谢谢!
What is the difference between the following two encoded strings?
%D0%9E%D0%BA%D0%B6%D1%8D%D0%B7
and
%26%231055%3B%26%231088%3B%26%231080%3B%26%231074%3B%26%231077%3B%26%231090%3B
I am trying to URL Encode the russian text "Привет" into the second encoded string above (the W3Schools encoder does it correctly), but the URL encoder that I am using keeps giving me the first encoded string above. I am using URLUTF8Encoder.java from the W3 consortium. I have to use this one as I am working on a mobile platform requiring J2ME.
Thanks!
原文:https://stackoverflow.com/questions/5954432
最满意答案
您需要将
server: true
添加到Endpoint
的配置中:config :my_reelty, MyReelty.Endpoint, server: true
phoenix.new
可能已经使用server: false
生成了类似的配置server: false
(在v1.2.0中它适用于我),所以你可以将false
更改为true
。You need to add
server: true
to theEndpoint
's config:config :my_reelty, MyReelty.Endpoint, server: true
The
phoenix.new
may have already generated similar config withserver: false
(it does for me in v1.2.0), so you can just change thatfalse
totrue
.
相关问答
更多-
用IEx调试phoenix测试(Debug phoenix test with IEx)[2021-02-09]
要检查conn结构(或任何其他变量)内部的内容,您可以使用IO.inspect conn并像往常一样使用mix test运行测试 - 这里不需要使用IO.inspect conn 。 例如: defmodule HelloWeb.PageControllerTest do use HelloWeb.ConnCase test "GET /", %{conn: conn} do IO.inspect conn conn = get conn, "/" assert html_r ... -
如何测试多数据库Elixir(Phoenix,Ecto)应用程序(How to test a multi database Elixir (Phoenix, Ecto) app)[2022-02-19]
首先,您需要在lib/my_app.ex启动repo # Start the Ecto repository worker(MyApp.DbStatusRepo, []), worker(MyApp.DbDefinitionRepo, []), 接下来,在test/test_helper.exs准备repo Mix.Task.run "ecto.create", ["--quiet", "-r", "MyApp.DbDefinitionRepo"] Mix.Task.run "ecto.migrate", ... -
为什么Ember模拟服务器在验收测试期间没有运行?(Why does the Ember mock server not run during acceptance tests?)[2021-08-29]
这些模拟是一个已知的问题,它们不适用于验收测试。 看看使用Ember-CLI-Mirage,这是它编写的主要原因之一。 It's a known issue with those mocks that they don't work for acceptance tests. Look into using Ember-CLI-Mirage, that's one of the main reasons it was written. -
Phoenix服务器不会重启(Phoenix server won't restart)[2022-01-31]
在与Elixir Slack渠道的优秀人员讨论后,我找到了解决方案。 这是一个被绞死的服务器进程。 我不得不做一个ps aux|grep phoenix ,找到进程的pid,然后使用kill -9杀死它,其中 是挂起的phoenix.server服务的编号。 After discussing with the good fellows of Elixir Slack channel I found the solution. It was a hanged server process. ... -
您需要将server: true添加到Endpoint的配置中: config :my_reelty, MyReelty.Endpoint, server: true phoenix.new可能已经使用server: false生成了类似的配置server: false (在v1.2.0中它适用于我),所以你可以将false更改为true 。 You need to add server: true to the Endpoint's config: config :my_reelty, MyReelty ...
-
Phoenix.ChannelTest.join调用Phoenix.Channel.Server.socket/1 , 该调用使GenServer调用通道并且没有可配置的超时时间,以从GenServer的状态获取底层套接字。 我相信,既然您从join函数向自己发送消息,那么在测试代码能够获取套接字值之前由GenServer处理该消息,并且由于该调用的默认超时时间为5秒,您会收到此超时错误。 解决这个问题的方法是使用Process.send_after/3稍微延迟send给self : Process.sen ...
-
在您的代码中,您需要使用IEx模块并将IEx.pry放在要调试的位置: defmodule MyModule do require IEx def my_function do IEx.pry end end 然后在IEx上下文中运行您的凤凰服务器: iex -S mix phoenix.server In your code you need to require the IEx module and place an IEx.pry where you wa ...
-
该错误意味着Phoenix.Endpoint.Server无法启动:ranch_listener_sup因为:ranch_server未运行。 这是因为你没有开始cowboy (牧场是cowboy的依赖,并且如果你开始cowboy会自动启动)在你的测试环境中。 要解决此问题,您可以将以下内容添加到test/test_helper.exs的顶部: Application.ensure_all_started(:cowboy) 或者将其作为依赖项添加到:test mix.exs :test env: defp ...
-
这是一行失败: Agent.get(:"#{matched_client_email}" ...) 发生这种情况是因为此Agent不一定已启动。 您在测试中检查的内容是不同的,要复制您应该执行的操作: iex(20)> Agent.start_link(fn -> %{} end, name: :"blah") {:ok, #PID<0.365.0>} iex(21)> Agent.get(:"foo", &(Map.get(&1, "sdfs"))) # NOTE :foo 可以明确检查目标Agent ...
-
Phoenix Build失败了。(Phoenix Build fail. Cannot find Symbol. Phoenix 4.8.2 Hbase-1.2 cdh 5.9.1)[2023-01-09]
最后为cdh5.9.1(Hbase 1.2.0和Hadoop 2.6.0)成功构建了Phoenix 4.8.2。 这些问题是由于Phoenix 4.8.2与cdh5.9.1不兼容造成的。 在尝试更改phoenix代码以成功编译之后,我从这个repo中检出了phoenix 4.8Hbase-1.2-cdh5.8分支,其中大部分代码更改已经完成以使其兼容: https://github.com/chiastic-security/phoenix-for-cloudera/branches 原来这个分支虽然对于c ...