首页 \ 问答 \ 两个URL编码字符串之间的Java差异(Java difference between two URL Encoded strings)

两个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
更新时间:2022-09-16 06:09

最满意答案

您需要将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.Endpoint, server: true

The phoenix.new may have already generated similar config with server: false (it does for me in v1.2.0), so you can just change that false to true.

相关问答

更多
  • 要检查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 ...
  • 首先,您需要在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-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.
  • 在与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 ...
  • 最后为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 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。